Advertisement
Guest User

Untitled

a guest
Oct 24th, 2013
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. <?php
  2. require '../PHPMailerAutoload.php';
  3.  
  4. //Create a new PHPMailer instance
  5. $mail = new PHPMailer();
  6. //Set who the message is to be sent from
  7. $mail->setFrom('admin@philspropertyrealty.com', 'First Last');
  8. //Set an alternative reply-to address
  9. $mail->addReplyTo('ebestwebmaster@philspropertyrealty.com', 'Admin Main');
  10. //Set who the message is to be sent to
  11. $mail->addAddress('erickbestism@gmail.com', 'First Last');
  12. //Set the subject line
  13. $mail->Subject = 'PHPMailer mail() test';
  14. //Read an HTML message body from an external file, convert referenced images to embedded,
  15. //convert HTML into a basic plain-text alternative body
  16. $mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__));
  17. //Replace the plain text body with one created manually
  18. $mail->AltBody = 'This is a plain-text message body';
  19. //Attach an image file
  20. $mail->addAttachment('images/phpmailer_mini.gif');
  21.  
  22. //send the message, check for errors
  23. if (!$mail->send()) {
  24. echo "Mailer Error: " . $mail->ErrorInfo;
  25. } else {
  26. echo "Message sent!";
  27. }
  28. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement