Re: Newbie question about sending email

From: Date: Thu, 17 Apr 2008 16:37:06 +0000
Subject: Re: Newbie question about sending email
References: 1 2 3 4 5 6 7 8  Groups: php.general 
Request: Send a blank email to php-general+get-273195@lists.php.net to get a copy of this message
Daniel Brown has written on 4/17/2008 12:29 PM:
    I'll reiterate:
       "Note the mail() parameters.  There's no header information there."
            RTFM: http://php.net/mail
    You just have your mail() function wrong.  Reiterating my code as
well (with updated field_4 data): <?php $where_form_is = "http://".$_SERVER['SERVER_NAME'].dirname($_SERVER['PHP_SELF'])."/"; $to = "4sam-nj-subscribe@yahoogroups.com,pjh42@pobox.com"; $subject = "SUBSCRIBE"; $from = $_POST['field_4']; $body = "Form data: Name: ".$_POST['field_1']." Street Address: ".$_POST['field_2']." Phone Number: ".$_POST['field_3']." Email Address: ".$_POST['field_4']." powered by phpFormGenerator, but fixed by PHP-General!"; $headers = "From: \"".$_POST['field_1']."\" <".$_POST['field_4'].">\r\n"; $headers .= "X-Mailer: PHP/".phpversion()."\r\n"; include("confirm.html"); ?>
OK. I don't see a mail() in your code. Would it be mail($to, $subject, $body, $headers); ?

« previous php.general (#273195) next »