Advertisement
Guest User

Untitled

a guest
Feb 7th, 2016
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. <?php
  2.  
  3. include ("lib/PHPMailerAutoload.php");
  4. $sen_name = "";
  5. $sen_email = "";
  6. $rec_email = "";
  7. $email_sub = "";
  8. $box_msg = "";
  9.  
  10. $mail = new PHPMailer();
  11. // Telling the class to use SMTP
  12. $mail->IsSMTP();
  13. $mail->Mailer = "smtp";
  14. $mail->Host = "smtp.mandrillapp.com";
  15. $mail->Port = 587;
  16. // Turn on SMTP authentication
  17. $mail->SMTPAuth = true;
  18. // SMTP Username
  19. $mail->Username = "";
  20. // SMTP Password ( i.e. Any valid Mandrill API key)
  21. $mail->Password = "";
  22.  
  23. $rec_email = ""; // Your email address will be here
  24. $sen_name = $_POST[name];
  25. $email_sub = ""; // Your email subject will be here
  26. $sen_email = ""//$_POST[email];
  27. $box_msg = ""//$_POST[message];
  28.  
  29. $mail->From = $sen_email;
  30. $mail->FromName = $sen_name;
  31. $mail->AddAddress($rec_email);
  32. $mail->Subject = $email_sub;
  33. $mail->Body = $box_msg;
  34. $mail->WordWrap = 50;
  35.  
  36. if (($sen_email != "") && ($rec_email != "" )) {
  37. // Sending Email
  38. $status = $mail->Send();
  39. echo"Email Sent !";
  40. }
  41. else
  42. {
  43. echo"<p>The mail() function failed.</p>";
  44. }
  45. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement