Re: How to make mail() use correct headers?
| From: | Ross Honniball | Date: | Mon, 11 Jul 2005 22:11:15 +0000 |
| Subject: | Re: How to make mail() use correct headers? | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-26202@lists.php.net to get a copy of this message | ||
I haven't looked to see exactly what headers it produces, but using:
$old = ini_set('sendmail_from', 'whoever@whatever');
before you use the mail() function works for me.
anton wrote:
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