note 79139 deleted from function.mail by betz

From: Date: Tue, 13 Nov 2007 14:05:49 +0000
Subject: note 79139 deleted from function.mail by betz
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-132224@lists.php.net to get a copy of this message
Note Submitter: Jan den Ouden ---- When I am using 2 recipient addresses, I have noticed that the mail() command will start 2 smtp sessions. One session succeeds and sends the mail to the 2 addresses. The other session will fail with SMTP error 513. My php script (run from command prompt) will show the following on screen: C:\PHP\Scripts>php websitelog.php PHP Warning: mail(): SMTP server response: 513 &lt;&gt;, Invalid syntax in C:\P HP\Scripts\send_mail.php on line 94 Content-type: text/html X-Powered-By: PHP/4.3.10 I am using the send_mail script as uploaded by another user on this forum. This script uses the built-in mail() command. It makes no difference if: - I use a seperate To and Cc header or only a To header containing both addresses. - use syntax UserName <user@mydomain.com> or the bare address - use "<" and ">" characters or not - use Reply-to, Return-path, From headers or not It is not a big problem because the mail is sent 1 time OK, but it looks strange to me that php start 2 smtp sessions, apparently in 2 different ways. I know it does this from the log files of my mail server (MDaemon 6.8) There I can see that first line of the body is used in a RCPT TO command (??!!), which causes the error. See part of the log file: RCPT TO:<sysadm@imres.nl> 250 <sysadm@imres.nl>, Recipient ok RCPT TO:< Summary of website uploads 0 csv (database) file has been uploaded 513 <of website uploads 0 csv file has been uploaded 0 Excel sheets have been uploaded Any one any idea why php starts the second, unnesessary and wrong smtp session?

« previous php.notes (#132224) next »