PHP Anthology send mail -SMTP server response: 550 Access denied - Invalid HELO name

I’m trying to use some code from the PHP Anthology book. I’m having trouble sending mail using the simple method from pg 180:

', ‘Howdy’, ‘Glad to meet you.’,

and also the Pear version from 180/181:

// to remove the E_STRICT errors created by the PHP4 code in Mail
// include Mail class
require ‘Mail.php’;
// choose which backend type we want
$mail = Mail::factory(‘mail’);
// some headers we want to send
$headers = array(
‘From’ => ‘’,
‘Subject’ => ‘Howdy’
// send the email
$succ = $mail->send(‘’, $headers, ‘Glad to meet you.’);
// Check for sending errors
if (PEAR::isError($succ))
echo 'Email sending failed: ’ . $succ->getMessage();
echo ‘Email sent succesfully’;

Here is the full error message:
Warning: mail() [function.mail]: SMTP server response: 550 Access denied - Invalid HELO name (See RFC2821 in C:\pear\pear\Mail\mail.php on line 153

I’m guessing that I have setup my php.ini file mail settings incorrectly, but not sure how to make a fix.

I’ve made these changes to the ini:

smtp_port = 25
sendmail_from =

Any help is appreciated.

  • Stan.

you are trying to connect to to send the email. try sending it from your machine instead.

SMTP = localhost
smtp_port = 25

Thanks for your help. I’ve changed SMTP and the port. Now I receive the following message:

Warning: mail() [function.mail]: Failed to connect to mailserver at “localhost” port 25, verify your “SMTP” and “smtp_port” setting in php.ini or use ini_set() in…

you need a mail server that listens to port 25

Thanks. That appears to be the problem. I’ve installed “Free SMTP Server” and I can run limited testing with it, but only limited. Any suggestions on a good (free) SMTP Server to run on windows?