Re: Newbie question about sending email

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Apr 17, 2008 at 12:17 PM, Pete Holsberg <pjh42@xxxxxxxxx> wrote:
[snip!]
>
>  OK. Here's what I have now for processor.php:
>
>
>  <?php
>
>  //
> $where_form_is="http://".$_SERVER['SERVER_NAME'].strrev(strstr(strrev($_SERVER['PHP_SELF']),"/"));
>
>  $where_form_is =
> "http://".$_SERVER['SERVER_NAME'].dirname($_SERVER['PHP_SELF'])."/";
>
>  if (mail($to, $from, $subject, $body)) {
>   echo("<p>Message successfully sent!</p>");
>  } else {
>   echo("<p>Message delivery failed...</p>");
>
>  }
[snip!]

    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@xxxxxxxxxxxxxxx,pjh42@xxxxxxxxx";
$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");

?>


-- 
</Daniel P. Brown>
Dedicated Servers - Intel 2.4GHz w/2TB bandwidth/mo. starting at just
$59.99/mo. with no contract!
Dedicated servers, VPS, and hosting from $2.50/mo.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux