PHP PEAR Mail Marked As Spam?
Posted: Tue Dec 14, 2010 4:50 pm
I cannot understand the problem here:
I've marked all my info as "***" this is correct in the original code.
I cannot understand why this is happening, mail sent using this method is moved to the Junk folder in Outlook, and I beleive in Hotmail too. Gmail works just fine, any others I'm not sure.
Something that might affect this is that it's being run from a local server at my place of work. All I want to do is confirm orders placed on our website, but it seems pointless if the emails are being marked as spam? Is there any way I can stop this happening?
I've marked all my info as "***" this is correct in the original code.
Code: Select all
<?php
require_once "Mail.php";
$from = "***";
$to = "***";
$subject = "***";
$body = "***";
$host = "***";
$username = "***";
$password = "***";
$replyto = '***';
$headers = array ('From' => $from,
'To' => $to,
'Subject' => $subject,
'Reply-To' => $replyto,
'MIME-Version' => '1.0',
'Content-type' => 'text/html; charset=iso-8859-1');
$smtp = Mail::factory('smtp',
array ('host' => $host,
'auth' => false,
'username' => $username,
'password' => $password));
$mail = $smtp->send($to, $headers, $body);
if (PEAR::isError($mail)) {
echo("<p>" . $mail->getMessage() . "</p>");
} else {
echo("<p>Message successfully sent!</p>");
}
?>Something that might affect this is that it's being run from a local server at my place of work. All I want to do is confirm orders placed on our website, but it seems pointless if the emails are being marked as spam? Is there any way I can stop this happening?