mail function and headers

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

 



Hi,

i'm playing a little bit with the mail function from PHP 5.2.4 and email
headers.
here is a snippet of my code:

> $headers = 'From: '.$email."< ".$fromname."
> >\r\n".'Reply-To:'.$email."\r\n".'X-Mailer: PHP/' . phpversion();

if (mail($to, $subject, $body,$headers))

{
>
...
>
}
>

where:
$fromname = $name.",".$firstname;

when i run this code, and click on button "reply-to" it works well... i mean
i reply to end user email address ($email).
but i can see in my "FROM-TO" header space

> From: correct_email_address [mailto:name@strange_email@including_partial_domain_name_of_mywebhosting]
>
>
>
"correct_email_address" is referencing to $email without problem.
but the problem comes from "strange_email@including
_partial_domain_name_of_mywebhosting".
in fact, before @ i get a crazy value and why the rest (after @) i get my
webhosting domain name ?

can i turn this strange email address to the same as $email, in order to
have "From : my_email_address@xxxxxxxxxxx [mailto:
my_email_address@xxxxxxxxxxx]" ?

thanks a lot,

Alain
------------------------------------
Windows XP SP2
PostgreSQL 8.2.4 / MS SQL server 2005
Apache 2.2.4
PHP 5.2.4
C# 2005-2008

[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