Advertisement
Guest User

Untitled

a guest
Apr 16th, 2012
6,608
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.93 KB | None
  1. PHPmailer sending mail to spam in hotmail. how to fix?
  2. require_once('../PHPMailer/class.phpmailer.php');
  3. //include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded
  4.  
  5. $mail = new PHPMailer();
  6.  
  7. $mail->IsSMTP(); // set mailer to use SMTP
  8. $mail->Host = "mail.xxx.com"; // specify main and backup server
  9. $mail->SMTPAuth = true; // turn on SMTP authentication
  10. $mail->Username = "xxx"; // SMTP username -- CHANGE --
  11. $mail->Password = "xxx"; // SMTP password -- CHANGE --
  12. $mail->Port = "25"; // SMTP Port
  13.  
  14. $mail->From = "no-repy@xxx.com"; //From Address -- CHANGE --
  15. $mail->FromName = "xxx"; //From Name -- CHANGE --
  16. $mail->AddAddress($email, $passerusername); //To Address -- CHANGE --
  17. $mail->AddReplyTo("no-reply@xxx.com", "xxx"); //Reply-To Address -- CHANGE --
  18.  
  19. $mail->WordWrap = 50; // set word wrap to 50 characters
  20. $mail->IsHTML(false); // set email format to HTML
  21.  
  22. $mail->Subject = "AuthSMTP Test";
  23. $mail->Body = "AuthSMTP Test Message!";
  24.  
  25. if(!$mail->Send())
  26. {
  27. echo "Message could not be sent. <p>";
  28. echo "Mailer Error: " . $mail->ErrorInfo;
  29. exit;
  30. }
  31.  
  32. echo "Message has been sent";
  33.  
  34.  
  35. }
  36.  
  37. $result = '';
  38.  
  39. $result .= $this->HeaderLine("Organization" , SITE);
  40. $result .= $this->HeaderLine("Content-Transfer-encoding" , "8bit");
  41. $result .= $this->HeaderLine("Message-ID" , "<".md5(uniqid(time()))."@{$_SERVER['SERVER_NAME']}>");
  42. $result .= $this->HeaderLine("X-MSmail-Priority" , "Normal");
  43. $result .= $this->HeaderLine("X-Mailer" , "Microsoft Office Outlook, Build 11.0.5510");
  44. $result .= $this->HeaderLine("X-MimeOLE" , "Produced By Microsoft MimeOLE V6.00.2800.1441");
  45. $result .= $this->HeaderLine("X-Sender" , $this->Sender);
  46. $result .= $this->HeaderLine("X-AntiAbuse" , "This is a solicited email for - ".SITE." mailing list.");
  47. $result .= $this->HeaderLine("X-AntiAbuse" , "Servername - {$_SERVER['SERVER_NAME']}");
  48. $result .= $this->HeaderLine("X-AntiAbuse" , $this->Sender);
Advertisement
RAW Paste Data Copied
Advertisement