Advertisement
Guest User

Untitled

a guest
Nov 19th, 2016
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.15 KB | None | 0 0
  1. enter code here
  2.  
  3.  
  4. <?php
  5. require_once('/class.phpmailer.php');
  6. require_once('/class.pop3.php'); // required for POP before SMTP
  7.  
  8. $pop = new POP3();
  9. $pop->Authorise('pop3.yahoo.com',465,10, 'arsalansherwani@yahoo.com',
  10. '******',1);
  11.  
  12. $mail = new PHPMailer();
  13. $msg='Name';
  14. //$body = file_get_contents('contents.html');
  15. //$body = eregi_replace("[]",'',$body);
  16. $address='arsalanjawed619.com';
  17. $mail->IsSMTP();
  18. $mail->SMTPDebug = 1;
  19. $mail->Host = 'pop3.yahoo.com';
  20.  
  21. $mail->SetFrom('arsalansherwani@yahoo.com', 'arsalan');
  22.  
  23. $mail->AddReplyTo("arsalansherwani@yahoo.com","arsalan");
  24.  
  25. $mail->Subject = "PHPMailer Test Subject via POP before SMTP, basic";
  26.  
  27. $mail->AltBody = "To view the message, please use an HTML compatible email viewer!";
  28.  
  29. $mail->MsgHTML($msg);
  30.  
  31. $address = "arsalanjawed619@yahoo.com";
  32. $mail->AddAddress($address, "arsalan");
  33.  
  34. //$mail->AddAttachment("images/phpmailer.gif"); // attachment
  35. //$mail->AddAttachment("images/phpmailer_mini.gif"); // attachment
  36.  
  37.  
  38. if(!$mail->Send()) {
  39. echo "Mailer Error: " . $mail->ErrorInfo;
  40. } else {
  41. echo "Message sent!";
  42. }
  43. ?>
  44.  
  45. $pop->Authorise('smtp.mail.yahoo.com',465,10, 'arsalansherwani@yahoo.com',
  46. '******',1);
  47.  
  48. <?php
  49. require_once('class.phpmailer.php');
  50. require_once('class.pop3.php');
  51. require_once('class.smtp.php');
  52. $pop = new POP3();
  53. $pop->Authorise('mailserver001.mydomain.com', 110, 30, 'username', 'password', 1);
  54. $mail = new PHPMailer();
  55. $mail->IsSMTP();
  56. $mail->Debugoutput = 'html';
  57. $mail->SMTPDebug = 2;
  58. $mail->SMTPOptions = array(
  59. 'ssl' => array(
  60. 'verify_peer' => false,
  61. 'verify_peer_name' => false,
  62. 'allow_self_signed' => true)
  63. );
  64. $mail->Host = 'mailserver001.mydomain.com';
  65. $mail->SetFrom('info@mydomain.com', 'Name');
  66. $mail->AddReplyTo("info@mydomain.com","Name");
  67. $mail->Subject = "Welcome";
  68. $mail->AltBody = "To view the message, please use an HTML compatible email viewer!";
  69. $mail->MsgHTML('HTML');
  70. $address = "myname@otherdomain.com";
  71. $mail->AddAddress($address, "Name");
  72. if(!$mail->Send()) {
  73. echo "Mailer Error: " . $mail->ErrorInfo;
  74. } else {
  75. echo "Message sent!";
  76. }
  77. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement