windows mail problem

From: Date: Mon, 24 May 2004 09:13:54 +0000
Subject: windows mail problem
Groups: php.windows 
Request: Send a blank email to php-windows+get-23819@lists.php.net to get a copy of this message
Hi there, I've been having difficulty sending emails from Windows machines. I've seen this problem in a few places before but I can't seem to fix it on my machine. When I try to use mail() I get : mail(): "sendmail_from" not set in php.ini or custom "From:" header missing The code I'm using is : $headers = "From: $email\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/plain; charset=iso-8859-1\r\n"; $headers .= "Reply-To: $email\r\n"; $headers .= "X-Priority: 3\r\n"; $headers .= "X-MSMail-Priority: Normal\r\n"; $headers .= "X-Mailer: My Application"; $ok = @mail($friendMail, $CHALLENGE_MAIL_SUBJECT, $mailText, $headers); This has worked on my linux server before. It is saying I haven't set a From header but as you can see I have and my php.ini looks like this : [mail function] ; For Win32 only. SMTP = localhost sendmail_from = my@email.com The mail server is running and should be accepting connections. I've tried the IIS SMTP server and also Argosoft, set both of them to accept connections but it doesn't seem to get as far as the SMTP server. I've tried it on my local machine (XP Pro, IIS 5, PHP 4.3.6) and on the production server (Win 2003, IIS 6, PHP 4.3.6). I've restarted and done all the things I've found suggested for this problem but no joy. Can anyone help? Thanks for your time, Andy Tawse.

« previous php.windows (#23819) next »