Guest User

Untitled

a guest
Oct 18th, 2017
866
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.14 KB | None | 0 0
  1. <?
  2. require("class.phpmailer.php");
  3. $mail = new PHPMailer();
  4. $mail->IsSMTP(); // send via SMTP
  5. IsSMTP(); // send via SMTP
  6. $mail->SMTPAuth = true; // turn on SMTP authentication
  7. $mail->Username = "muthuvvalliappan@gmail.com"; // SMTP username
  8. $mail->Password = "9003383178"; // SMTP password
  9. $webmaster_email = "keyankarthi1991@gmail.com"; //Reply to this email ID
  10. $email="donaly10@gmail.com"; // Recipients email ID
  11. $name="name"; // Recipient's name
  12. $mail->From = $webmaster_email;
  13. $mail->FromName = "Webmaster";
  14. $mail->AddAddress($email,$name);
  15. $mail->AddReplyTo($webmaster_email,"Webmaster");
  16. $mail->WordWrap = 50; // set word wrap
  17. //$mail->AddAttachment("/var/tmp/file.tar.gz"); // attachment
  18. //$mail->AddAttachment("/tmp/image.jpg", "new.jpg"); // attachment
  19. $mail->IsHTML(true); // send as HTML
  20. $mail->Subject = "This is the subject";
  21. $mail->Body = "Hi,
  22. This is the HTML BODY "; //HTML Body
  23. $mail->AltBody = "This is the body when user views in plain text format"; //Text Body
  24. if(!$mail->Send())
  25. {
  26. echo "Mailer Error: " . $mail->ErrorInfo;
  27. }
  28. else
  29. {
  30. echo "Message has been sent";
  31. }
  32. ?>
  33. <html>
  34. <head>
  35. <title>this is mailer</title>
  36. </head>
  37. <body>
  38. sedding
  39. </body>
  40. </html>
Add Comment
Please, Sign In to add comment