Getting Email to Work from Production Server
-
When run locally, the emails go out. I’m not sure why. We do have an exchange server, which I can ping locally (mail.mytestcompany.com). Locally, it’s on Windows 7 with IIS. The WordPress is run off of WAMP using localhost:81. The production server is outside the firewall and has Windows 2008 R2, with no IIS or email server. It has WAMP. All emails going out fail on this server. Any ideas to get the emails to go out on the production server? I tried using a gmail account by modifiying the code below, including passing a username and paaword, but that didn’t work. The PHP code that sends them out is (email address changed to a generic example for privacy):
$headers = “MIME-Versin: 1.0\r\n” .
“Content-type: text/plain; charset=ISO-8859-1; format=flowed\r\n” .
“Content-Transfer-Encoding: 8bit\r\n” .
“From: My Test Company <mail@mytestcompany.com>\r\n” .
“X-Mailer: PHP” . phpversion();//ini_set(“SMTP”,”mail.mytestcompany.com”); // Mail Server
//ini_set(“smtp_port”, “25”); // SMTP Port
//ini_set(“sendmail_from”, “mail@mytestcompany.com”); //return address$result = mail(implode(“,”, $recipients), $subject, $mail_body, $headers); //mail command
if($result) {
$mailString = $timestamp . ” ” . $delimiter . “mail success: ” . implode(“,”, $recipients) . “\r\n”;
} else {
$mailString = $timestamp . ” ” . $delimiter . “mail failure: ” . implode(“,”, $recipients) . “\r\n”;
}
The topic ‘Getting Email to Work from Production Server’ is closed to new replies.