Tutorial by Examples

A typical email has three main components: A recipient (represented as an email address) A subject A message body Sending mail in PHP can be as simple as calling the built-in function mail(). mail() takes up to five parameters but the first three are all that is required to send an email (al...
<?php $to = '[email protected]'; $subject = 'Sending an HTML email using mail() in PHP'; $message = '<html><body><p><b>This paragraph is bold.</b></p><p><i>This text is italic.</i></p></body></html>'; $headers =...
Basic Text Email <?php $mail = new PHPMailer(); $mail->From = "[email protected]"; $mail->FromName = "Full Name"; $mail->addReplyTo("[email protected]", "Reply Address"); $mail->Subject = "Subject Text"; $mail->Body ...
<?php $to = '[email protected]'; $subject = 'Email Subject'; $message = 'This is the email message body'; $attachment = '/path/to/your/file.pdf'; $content = file_get_contents($attachment); /* Attachment content transferred in Base64 encoding MUST be split into chunk...
<?php $mail = new PHPMailer(); $mail->From = "[email protected]"; $mail->FromName = "Full Name"; $mail->addReplyTo("[email protected]", "Reply Address"); $mail->addAddress("[email protected]", "Recepient Name&quot...
<?php $mail = new PHPMailer(); $mail->From = "[email protected]"; $mail->FromName = "Full Name"; $mail->addReplyTo("[email protected]", "Reply Address"); $mail->Subject = "Subject Text"; $mail->Body = "This is...
Basic Text Email <?php $sendgrid = new SendGrid("YOUR_SENDGRID_API_KEY"); $email = new SendGrid\Email(); $email->addTo("[email protected]") ->setFrom("[email protected]") ->setSubject("Subject Text") ->setTex...
<?php $sendgrid = new SendGrid("YOUR_SENDGRID_API_KEY"); $email = new SendGrid\Email(); $email->addTo("[email protected]") ->setFrom("[email protected]") ->setSubject("Subject Text") ->setText("This is a ...

Page 1 of 1