RE: [PHP-WIN] How to make mail() use correct headers?
| From: | Rodrigo | Date: | Mon, 11 Jul 2005 08:58:44 +0000 |
| Subject: | RE: [PHP-WIN] How to make mail() use correct headers? | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-26200@lists.php.net to get a copy of this message | ||
Try using the extra PHP parameter:
mail($mailto, $mailsubject, $mailmessage, $mailheaders, "-f".$mailfrom);
or
mail($mailto, $mailsubject, $mailmessage, $mailheaders,
"-fuser@domain.com");
This user has to be added to the /etc/mail/trusted-users otherwise an
X-Warning header will be added to the mail.
Grtz
Rodrigo
-----Original Message-----
From: anton [mailto:antonmo@swipnet.se]
Sent: maandag 11 juli 2005 9:51
To: php-windows@lists.php.net
Subject: [PHP-WIN] How to make mail() use correct headers?
Hello,
Our windows server has sendmail_from set to null in ini. We are hosting many
domains, and having a single address there makes no sense.
With null all mails that go out through our mailserver do not get a from
address. The from address is only ommunicated with additional mail headers
when using
$sendto = "to@mail.com";
$from = "from@mail.com";
$headers = "From: $from\r\n";
mail($sendto, $subject, $message, $headers);
The result is:
127.0.0.1 220 radio-nation.com ESMTP MailEnable Service, Version: 1.8--
ready at 07/11/05 127.0.0.1 HELO HELO EV1SERVE-V7V9CP 250 Requested mail
action okay, 127.0.0.1 MAIL MAIL FROM:<> 250 Requested mail action okay,
completed 43 14
127.0.0.1 RCPT RCPT TO:<to@mail.com> 250 Requested mail action okay,
completed 43 27
127.0.0.1 DATA DATA 354 Start mail input; end with <CRLF>.<CRLF> 46 6
127.0.0.1 QUIT QUIT 221 Service closing transmission channel 42 6
As you can see no from address is given. The mail server then replaces this
with a default mail address, and if a mail should buonce, it would get to
the server admin, not the responsible domain owner.
This is a problem!!!
How do you configure the mail() or the server to use the correct from
address when sending mail ?? why is mail() not using the MAIL FROM:
correctly ?
(Please reply only to newsgroup)
Thank you
--
PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit:
http://www.php.net/unsub.php