|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
  [2002-05-20 19:05 UTC] chris at dvdplaza dot com dot au
 Since upgrading to the CVS of PHP 4.3 (HAD to - bug #16626 was causing us chronic chaos and this was the only means to correct it) I am getting the following error each time a script tries to e-mail: PHP Warning: mail() SMTP server response: 501 Syntax Error in parameters or arguments in *SCRIPTNAME* on line xxx PHP 4.3 is running as an Apache2 module on W2K, only additional module loaded is GZIP. Never had any e-mail problems before (other than time stamps on PHP e-mails being incorrect, a long-time known bug). PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             | |||||||||||||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 12:00:01 2025 UTC | 
The simplest example would probably be the one below, since the addresses are all hardcoded (simply an auto-notification for myself) whereas all other mailings are obviously dynamic: mail('form@dvdplaza.com.au', 'Invite Issued To ' . $PlazaUser[username], 'An invite was just produced for: ' . $PlazaUser[username], 'From: "DVD Plaza (Support)" <support@dvdplaza.com.au>');Using : - W2K Pro SP2 - Apache (version : Apache_1.3.27-win32-x86-no_src) - PHP (version : php-4.3.0-Win32) mail() works fine for me. I tested using different syntax : "something" <name@domain.com> just doesn't work. <name@domain.com> works (but < & > are not usfull at all), so just use : name@domain.com >[21 May 2002 4:49am] mfischer@php.net >First, the From: "DVD >Plaza (Support)" <support@dvdplaza.com.au> syntax isn't >supported on >win32 and never was. Only addresses in the simple form of >foo@bar.com >are supported. Here is a simple exemple that worked for me : function send_mail($from_email, $to_email, $subject, $message) { $header = "MIME-Version: 1.0\r\n"; $header .= "Content-Type: text/plain; charset=iso-8859-1\r\n"; $header .= "From: ".$from_email."\r\n"; $header .= "Reply-To : ".$from_email."\r\n"; $header .= "Return-Path : ".$from_email."\r\n"; $header .= "X-Priority: 1\r\n"; $header .= "X-MSMail-Priority: High\r\n"; $header .= "X-Mailer: PHP4\r\n"; return(mail($to_email, $subject, $message, $header)); }