Advertisement
Guest User

Untitled

a guest
May 26th, 2016
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. <?php
  2. $name=$_POST['Your_Name'];
  3. $email=$_POST['Your_Email'];
  4. $message=$_POST['Your_Add'];
  5. echo $name ;
  6.  
  7. // When we unzipped PHPMailer, it unzipped to
  8. // public_html/PHPMailer_5.2.0
  9. require("mailer/PHPMailerAutoload.php");
  10. require("mailer/class.smtp.php");
  11. require("mailer/class.phpmailer.php");
  12.  
  13. $mail = new PHPMailer();
  14.  
  15. // set mailer to use SMTP
  16. $mail->IsSMTP();
  17.  
  18. // we are setting the HOST to localhost
  19. $mail->Host = "mail.soumitrapendse.com"; // specify main and backup server
  20. $mail->SMTPAuth = true; // turn on SMTP authentication
  21.  
  22. $mail->Username = "*****@gmail.com"; // SMTP username
  23. $mail->Password = "******"; // SMTP password
  24.  
  25. $mail->From = $email;
  26.  
  27. // below we want to set the email address we will be sending our email to.
  28. $mail->AddAddress("***@gmail.com", "AAA");
  29.  
  30. // set word wrap to 50 characters
  31. $mail->WordWrap = 50;
  32. // set email format to HTML
  33. $mail->IsHTML(true);
  34.  
  35. $mail->Subject = "You have received feedback from your website!";
  36.  
  37. // $message is the user's message they typed in
  38. // on our contact us page. We set this variable at
  39. // the top of this page with:
  40. // $message = $_REQUEST['message'] ;
  41. $mail->Body = $message;
  42. $mail->AltBody ="Name : {$name}nnEmail : {$email}nnMessage : {$message}";
  43.  
  44. if(!$mail->Send())
  45. {
  46. echo "Message could not be sent. <p>";
  47. echo "Mailer Error: " . $mail->ErrorInfo;
  48. exit;
  49. }
  50. else
  51. {
  52. echo "Thank you for contacting us. We will be in touch with you very soon.";
  53. }
  54. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement