I have one of those things that should be simple, and yet for some reason it's throwing an error and no matter of trial and error seems to fix it.
I have a php script on our iseries that is trying to send an email as the result of a form being submitted.
The error I am getting is:
PHP Warning: mail(): Unable to send message to SMTP server. Syntax error. Special characters only permitted with escape character.
Zend Server Function Data shows the submitted values:
PHP Error
mail(): Unable to send message to SMTP server. Syntax error. Special characters only permitted with escape character.
Function information
mail (
'fred@mydomain.com',
'Contact Message from Web Site',
'test',
'MIME-Version: 1.0
Content-type: text/plain; charset=iso-8859-1
From: Tony <fred@mydomain.com>
Reply-To: Tony <fred@mydomain.com>
Subject: Contact Message from Web Site'
)
I can't see anything wrong with this, the "<" and ">" were coded correctly on output, and the only other special character is "@".
The header lines were separated by \r\n.
The line of code to send the email is:
Any ideas please? I have spent half a day trying everything I can think of.
It's not a CCSID issue with the iSeries I assume? We are in the UK, but I can't think of anything that would cause this.
---------------------------------------------------------------------------
Edited several hours later to add more information. Getting somewhere yet still getting nowhere...
I hard coded the parameters for the PHP mail command as follows:
The error I get now is:
mail(): Unable to send message to SMTP server. No recipients specified. ite. eady.
Function information
mail (
'tony@mydomain.com',
'test subject',
'test body',
'From: tony@mydomain.com'
)
The "ite. eady." is weird, doesn't appear in my sent data, and it's not even in the script I am using.
Hoping this helps a light to come on somewhere...
I have a php script on our iseries that is trying to send an email as the result of a form being submitted.
The error I am getting is:
PHP Warning: mail(): Unable to send message to SMTP server. Syntax error. Special characters only permitted with escape character.
Zend Server Function Data shows the submitted values:
PHP Error
mail(): Unable to send message to SMTP server. Syntax error. Special characters only permitted with escape character.
Function information
mail (
'fred@mydomain.com',
'Contact Message from Web Site',
'test',
'MIME-Version: 1.0
Content-type: text/plain; charset=iso-8859-1
From: Tony <fred@mydomain.com>
Reply-To: Tony <fred@mydomain.com>
Subject: Contact Message from Web Site'
)
I can't see anything wrong with this, the "<" and ">" were coded correctly on output, and the only other special character is "@".
The header lines were separated by \r\n.
The line of code to send the email is:
Code:
$sent = mail($to, $subject, $email_body, implode("\r\n", $headers));
It's not a CCSID issue with the iSeries I assume? We are in the UK, but I can't think of anything that would cause this.
---------------------------------------------------------------------------
Edited several hours later to add more information. Getting somewhere yet still getting nowhere...
I hard coded the parameters for the PHP mail command as follows:
Code:
$sent = mail('tony@mydomain.com', 'test subject', 'test body', 'From: tony@mydomain.com');
mail(): Unable to send message to SMTP server. No recipients specified. ite. eady.
Function information
mail (
'tony@mydomain.com',
'test subject',
'test body',
'From: tony@mydomain.com'
)
The "ite. eady." is weird, doesn't appear in my sent data, and it's not even in the script I am using.
Hoping this helps a light to come on somewhere...
Comment