Guest User

Untitled

a guest
Feb 11th, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. <?php
  2. require_once('../../mailer/mailconfig.php');
  3. include('../../mailer/newmail.php');
  4. $from = 'me@example.com';
  5. $to = 'you@example.com';
  6. $cc = 'alsome@example.com';
  7. $subj = 'Test Email';
  8. $htmlMsg = 'Hello, <b>Tom</b>!';
  9. $plainMsg = 'Hello, Tom!';
  10. $mail->From = $from;
  11. $mail->FromName = "John";
  12. $mail->AddAddress($to);
  13. $mail->AddCC($cc);
  14. $mail->IsHTML(true);
  15. $mail->Body = $htmlMsg;
  16. $mail->AltBody = $plainMsg;
  17. $mail->Subject = $subj;
  18. $mail->WordWrap = 70;
  19. if($mail->Send())
  20. {
  21. $successMsg = "Your message was sent!";
  22. }
  23. else
  24. {
  25. $successMsg = "Your message was NOT sent!" . ' Mailer error: ' . $mail->ErrorInfo;
  26. }
  27. ?>
  28.  
  29. <?php
  30. $mail = new PHPMailer();
  31. $mail->isSendMail(); // telling the class to use SMTP
  32. $mail->Host = "smtpexample.net"; // SMTP server
  33. ?>
Add Comment
Please, Sign In to add comment