note 79139 added to function.mail
| From: | JandenOuden at osu1 dot php dot net | Date: | Tue, 13 Nov 2007 13:23:31 +0000 |
| Subject: | note 79139 added to function.mail | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-132223@lists.php.net to get a copy of this message | ||
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 <>, 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?
----
Server IP: 85.12.26.134
Probable Submitter: 80.126.176.143
----
Manual Page -- http://www.php.net/manual/en/function.mail.php
Edit -- https://master.php.net/note/edit/79139
Del: integrated -- https://master.php.net/note/delete/79139/integrated
Del: useless -- https://master.php.net/note/delete/79139/useless
Del: bad code -- https://master.php.net/note/delete/79139/bad+code
Del: spam -- https://master.php.net/note/delete/79139/spam
Del: non-english -- https://master.php.net/note/delete/79139/non-english
Del: in docs -- https://master.php.net/note/delete/79139/in+docs
Del: other reasons-- https://master.php.net/note/delete/79139
Reject -- https://master.php.net/note/reject/79139
Search -- https://master.php.net/manage/user-notes.php