Advertisement
Guest User

Untitled

a guest
Apr 25th, 2017
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. <?php
  2. /**
  3. * This example shows sending a message using a local sendmail binary.
  4. */
  5.  
  6. require '../PHPMailerAutoload.php';
  7.  
  8. //Create a new PHPMailer instance
  9. $mail = new PHPMailer;
  10. // Set PHPMailer to use the sendmail transport
  11. $mail->isSendmail();
  12. //Set who the message is to be sent from
  13. $mail->setFrom('admin@iptv-2017.com', 'First Last');
  14. //Set an alternative reply-to address
  15. $mail->addReplyTo('admin@iptv-2017.com', 'First Last');
  16. //Set who the message is to be sent to
  17. $mail->addAddress('mrbanned@hotmail.it', 'John Doe');
  18. //Set the subject line
  19. $mail->Subject = 'PHPMailer sendmail test';
  20. //Read an HTML message body from an external file, convert referenced images to embedded,
  21. //convert HTML into a basic plain-text alternative body
  22. $mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__));
  23. //Replace the plain text body with one created manually
  24. $mail->AltBody = 'This is a plain-text message body';
  25. //Attach an image file
  26. $mail->addAttachment('images/phpmailer_mini.png');
  27.  
  28. //send the message, check for errors
  29. if (!$mail->send()) {
  30. echo "Mailer Error: " . $mail->ErrorInfo;
  31. } else {
  32. echo "Message sent!";
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement