Advertisement
Guest User

Untitled

a guest
Oct 24th, 2016
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title> MY MAIL </title>
  6. </head>
  7. <?php
  8. $account="abc@outlook.com";
  9. $password="****";
  10. $to="xyz@outlook.com";
  11. $from="abc@outlook.com";
  12. $from_name="ABC";
  13. $msg="Hello";
  14. $subject="Hello World";
  15.  
  16. include("phpmailer/class.phpmailer.php");
  17. $mail = new PHPMailer();
  18. $mail->IsSMTP();
  19. $mail->CharSet = 'UTF-8';
  20. $mail->Host = "smtp.live.com";
  21. $mail->SMTPAuth= true;
  22. $mail->Port = 587;
  23. $mail->Username= $account;
  24. $mail->Password= $password;
  25. $mail->SMTPSecure = 'tls';
  26. $mail->From = $from;
  27. $mail->FromName= $from_name;
  28. $mail->isHTML(true);
  29. $mail->Subject = $subject;
  30. $mail->Body = $msg;
  31. $mail->addAddress($to);
  32. $mail->SMTPDebug = 1;
  33. if(!$mail->send()){
  34. echo "Mailer Error: " . $mail->ErrorInfo;
  35. }else{
  36. echo "E-Mail has been sent";
  37. }
  38. ?>
  39. <body>
  40. </body>
  41. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement