tags:

views:

33

answers:

1

It seems that when I use the code similar to:

$name = "Some Name";
$account = "[email protected]";

$headers = "From: " . $name . " <" . $account . ">\n";

mail($sometarget, $somesubject, $somedata, $headers,
    "-f" . $account);

to send e-mails, mail() function on windows is using "From:" header value (here: "Some Name ") instead of value forced by "-f" parameter (here: "[email protected]") effectively ignoring this parameter. This causes problems on some e-mail servers.

Any ideas how to change this behaviour? Thanks in advance.

A: 

u can use PEAR Mail package and send email via smtp server. mail function has problems in windows servers.

rahim asgari
Yeah I know, I could also use plain sockets and talk to SMTP server as well, but it doesn't answer my question. If "-f" parameter is ignored in windows then, why:- it is not documented anywhere- mail implementation is not following RFC while extracting data form "From:" header - it should use mail address between < and >
kuba