This topic is locked
[SOLVED]

  mail() [function.mail]: SMTP server response: 550 must b

4/23/2010 7:09:37 PM
PHPRunner General questions
I
iwendlei author

I am getting this error: mail() [function.mail]: SMTP server response: 550 must be authenticated.
How do I fix this?

admin 4/26/2010

This error means your mail server requires SMTP authentication to send emails. Built-in PHP mail() function that PHPRunner uses doesn't support SMTP authentication.
The workaround is to use a custom PHP mail function for example this one:

http://phpmailer.worxware.com/index.php?pg=phpmailer

I
iwendlei author 4/27/2010



This error means your mail server requires SMTP authentication to send emails. Built-in PHP mail() function that PHPRunner uses doesn't support SMTP authentication.
The workaround is to use a custom PHP mail function for example this one:

http://phpmailer.worxware.com/index.php?pg=phpmailer


Very Kewl, Thanks!

I
iwendlei author 4/27/2010



This error means your mail server requires SMTP authentication to send emails. Built-in PHP mail() function that PHPRunner uses doesn't support SMTP authentication.
The workaround is to use a custom PHP mail function for example this one:

http://phpmailer.worxware.com/index.php?pg=phpmailer


This solved the error problem. However I don't understand how to properly apply this.
Where do I place this code?
//error_reporting(E_ALL);

error_reporting(E_STRICT);
date_default_timezone_set('America/Toronto');
require_once('C:\wamp\www\A4ADemo3\include\PHPMailer/class.phpmailer.php');

require_once('C:\wamp\www\A4ADemo3\include\PHPMailer/class.smtp.php');

//include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded
$mail = new PHPMailer();
$body = file_get_contents('contents.html');

$body = eregi_replace("[\]",'',$body);
$mail->IsSMTP(); // telling the class to use SMTP

$mail->Host = "smtp.hosting.com"; // SMTP server

$mail->SMTPDebug = 2; // enables SMTP debug information (for testing)

// 1 = errors and messages

// 2 = messages only

$mail->SMTPAuth = true; // enable SMTP authentication

$mail->Host = "smtp.hosting.com"; // sets the SMTP server

$mail->Port = 25; // set the SMTP port for the GMAIL server

$mail->Username = "my@mail.com"; // SMTP account username

$mail->Password = "secret"; // SMTP account password
$mail->SetFrom('name@yourdomain.com', 'First Last');
$mail->AddReplyTo("name@yourdomain.com","First Last");
$mail->Subject = "PHPMailer Test Subject via smtp, basic with authentication";
$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
$mail->MsgHTML($body);
$address = "your@address.com";

$mail->AddAddress($address, "John Doe");
$mail->AddAttachment("images/phpmailer.gif"); // attachment

$mail->AddAttachment("images/phpmailer_mini.gif"); // attachment
if(!$mail->Send()) {

echo "Mailer Error: " . $mail->ErrorInfo;

} else {

echo "Message sent!";

}

I
iwendlei author 4/27/2010



This solved the error problem. However I don't understand how to properly apply this.
Where do I place this code?
//error_reporting(E_ALL);

error_reporting(E_STRICT);
date_default_timezone_set('America/Toronto');
require_once('C:\wamp\www\A4ADemo3\include\PHPMailer/class.phpmailer.php');

require_once('C:\wamp\www\A4ADemo3\include\PHPMailer/class.smtp.php');

//include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded
$mail = new PHPMailer();
$body = file_get_contents('contents.html');

$body = eregi_replace("[\]",'',$body);
$mail->IsSMTP(); // telling the class to use SMTP

$mail->Host = "smtp.hosting.com"; // SMTP server

$mail->SMTPDebug = 2; // enables SMTP debug information (for testing)

// 1 = errors and messages

// 2 = messages only

$mail->SMTPAuth = true; // enable SMTP authentication

$mail->Host = "smtp.hosting.com"; // sets the SMTP server

$mail->Port = 25; // set the SMTP port for the GMAIL server

$mail->Username = "my@mail.com"; // SMTP account username

$mail->Password = "secret"; // SMTP account password
$mail->SetFrom('name@yourdomain.com', 'First Last');
$mail->AddReplyTo("name@yourdomain.com","First Last");
$mail->Subject = "PHPMailer Test Subject via smtp, basic with authentication";
$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
$mail->MsgHTML($body);
$address = "your@address.com";

$mail->AddAddress($address, "John Doe");
$mail->AddAttachment("images/phpmailer.gif"); // attachment

$mail->AddAttachment("images/phpmailer_mini.gif"); // attachment
if(!$mail->Send()) {

echo "Mailer Error: " . $mail->ErrorInfo;

} else {

echo "Message sent!";

}


Disregard! I have figured it out!!!
Thanks so much for this forum!