Howdie do,
I have a very simple script that is just suppose to email a confirmation email to users. However, I keep getting the following error:
authentication failure [SMTP: Failed to write to socket: not connected (code: 250, response: Hello localhost [127.0.0.1] SIZE 52428800 8BITMIME PIPELINING AUTH PLAIN LOGIN STARTTLS HELP)]
The script is below. Pear mail has been installed. And yea, the password is correct, but I didn't place it in the script on here. Has anybody seen this error before?
function send_email($from, $to, $subject, $body)
{
require_once "Mail.php";
global $debug;
$host = "localhost";
$username = "user";
$password = "*********";
$headers = array
(
'From' => $from,
'To' => $to,
'Subject' => $subject
);
$smtp = Mail::factory
(
'smtp',
array
(
'host' => $host,
'auth' => true,
'username' => $username,
'password' => $password
)
);
$mail = $smtp->send($to, $headers, $body);
if (PEAR::isError($mail) && $debug)
{
echo("<p>" . $mail->getMessage() . "</p>");
}
}
Edit:
The exim_mainlog is actually displaying this when the call goes through:
2013-09-06 15:50:51 SMTP connection from [127.0.0.1]:59845 (TCP/IP connection count = 1) 2013-09-06 15:50:51 SMTP connection from localhost [127.0.0.1]:59845 lost