Community Discussions and Support
503 No valid recipients specified error when using 'to' header

As far as I can see in the session log the PHP script attempts to send the DATA segment without first providing any RCPTs, which is an error according to the SMTP protocol. Headers that might appear in the DATA segment won't have any relevance for SMTP delivery. It's up to the sending client to extract RCPTs and provide them in a proper way in the SMTP transaction.

/Rolf 

<p>As far as I can see in the session log the PHP script attempts to send the DATA segment without first providing any RCPTs, which is an error according to the SMTP protocol. Headers that might appear in the DATA segment won't have any relevance for SMTP delivery. It's up to the sending client to extract RCPTs and provide them in a proper way in the SMTP transaction. </p><p>/Rolf </p>

The following works fine: (PHP)

mail("newuser@localhost.com", "Subject", "Body", "From: Admin@localhost.com\n");

 When I move the 'to' email to the headers:

mail("", "Subject", "Body", "From: Admin@localhost.com\nTo: newuser@localhost.com\n");

 I get the error "503 No valid recipients specified"

 This normally works, is there a reason for this to be interpretted differently?

<P>The following works fine: (PHP)</P> <P>mail("newuser@localhost.com", "Subject", "Body", "From: Admin@localhost.com\n");</P> <P> When I move the 'to' email to the headers:</P> <P>mail("", "Subject", "Body", "From: Admin@localhost.com\nTo: newuser@localhost.com\n");</P> <P> I get the error "503 No valid recipients specified"</P> <P> This normally works, is there a reason for this to be interpretted differently?</P>

Rather depends on what the PHP script actually sends to Mercury. To find out, switch on session logging in MercuryS, and post the result here.

/Rolf 

<p>Rather depends on what the PHP script actually sends to Mercury. To find out, switch on session logging in MercuryS, and post the result here.</p><p>/Rolf </p>

08:25:52.390: Connection from 127.0.0.1, Mon Sep 15 08:25:52 2008<lf>
08:25:52.390: << 220 localhost ESMTP server ready.<cr><lf>
08:25:52.390: >> HELO irc-go<cr><lf>
08:25:52.390: << 250 localhost Hello, irc-go.<cr><lf>
08:25:52.390: >> MAIL FROM:<Admin@localhost.com><cr><lf>
08:25:52.390: << 250 Sender OK - send RCPTs.<cr><lf>
08:25:52.390: >> DATA<cr><lf>
08:25:52.390: << 503 No valid recipients specified.<cr><lf>
08:25:52.390: >> QUIT<cr><lf>
08:25:52.390: << 221 localhost Service closing channel.<cr><lf>
08:25:52.406: --- Connection closed normally at Mon Sep 15 08:25:52 2008. ---
08:25:52.406:

 

Another possibly related issue is when I send a multipart email, it seems to replace double new lines with a single new line.  This makes the message body not appear.

 

&lt;P&gt;08:25:52.390: Connection from 127.0.0.1, Mon Sep 15 08:25:52 2008&amp;lt;lf&amp;gt; 08:25:52.390: &amp;lt;&amp;lt; 220 localhost ESMTP server ready.&amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt; 08:25:52.390: &amp;gt;&amp;gt; HELO irc-go&amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt; 08:25:52.390: &amp;lt;&amp;lt; 250 localhost Hello, irc-go.&amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt; 08:25:52.390: &amp;gt;&amp;gt; MAIL FROM:&amp;lt;&lt;A href=&quot;mailto:Admin@localhost.com%3E%3Ccr%3E%3Clf&quot;&gt;Admin@localhost.com&amp;gt;&amp;lt;cr&amp;gt;&amp;lt;lf&lt;/A&gt;&amp;gt; 08:25:52.390: &amp;lt;&amp;lt; 250 Sender OK - send RCPTs.&amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt; 08:25:52.390: &amp;gt;&amp;gt; DATA&amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt; 08:25:52.390: &amp;lt;&amp;lt; 503 No valid recipients specified.&amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt; 08:25:52.390: &amp;gt;&amp;gt; QUIT&amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt; 08:25:52.390: &amp;lt;&amp;lt; 221 localhost Service closing channel.&amp;lt;cr&amp;gt;&amp;lt;lf&amp;gt; 08:25:52.406: --- Connection closed normally at Mon Sep 15 08:25:52 2008. --- 08:25:52.406: &lt;/P&gt; &lt;P mce_keep=&quot;true&quot;&gt;&amp;nbsp;&lt;/P&gt; &lt;P&gt;Another possibly related issue is when I send a multipart email, it seems to replace double new lines with a single new line.&amp;nbsp; This makes the message body not appear.&lt;/P&gt; &lt;P mce_keep=&quot;true&quot;&gt;&amp;nbsp;&lt;/P&gt;

I've used this same php script on many other servers (with same version of php). It only stopped working when I used it with mercury on my local computer. I can only guess that it is not reading headers properly since I do specify a "To" header which does get sent, it's just ignoring it.

&lt;P&gt;I&#039;ve used this same php script on many other servers (with same version of php). It only stopped working when&amp;nbsp;I used it with mercury on my local computer. I can only guess that it is not reading headers properly since I do specify a &quot;To&quot; header which does get sent, it&#039;s just ignoring it.&lt;/P&gt;
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft