I cannot seem to get port 587
to send mail. I am capable of sending mail using port 25
. I'm using PEAR Mail to send this.
require_once "Mail.php";
/**************************************************
EDIT the following variables for your own use
***************************************************/
$from = "Noreply <noreply@host.com>";
$to = "Abc <abc@host.com>";
$subject = "Hi!"; //type in subject here
$host = "mail.host.com"; // also tried ssl://mail.host.com and tls://mail.host.com
$username = "noreply@host.com"; // Your user / full email address
$password = "password"; // Password to your email address
/**************************************************
***************************************************/
$body = "test message";
$headers = array (
'From' => $from,
'To' => $to,
'Date' => date('Y-m-d H:i:s'),
'Subject' => $subject);
$smtp = Mail::factory('smtp',
array ('host' => $host,
'auth' => true,
'username' => $username,
'password' => $password,
'port'=>587));
$mail = $smtp->send($to, $headers, $body);