Hi is there a way for me to change the from header in the php mail function as it displays supermix@lotus.x10hosting or something like that, and also the return path.
Hi is there a way for me to change the from header in the php mail function as it displays supermix@lotus.x10hosting or something like that, and also the return path.
Just utilize the headers options in the mail() function.
e.g.
PHP Code:$to="user@server.com";
$subject="Mail Topic";
$message="The mail contents.... blah blah blah...";
$headers ="From: Sender Name <sender@email.address>";
$headers.="Return-path: email-address@receivingthe.reply";
$headers.="CC: another@email.tosendto";
mail($to,$subject,$message,$headers);
Don't get me wrong as I believe if and when I help someone I also help myself whereby whatever someone learns I also learn.
But I will also accept credits or reps if you really want to part with it.
Most of what dickey writes is right, but he made a very important mistake:
the headers have to be separated by \r\n, or nobody will ever know what you're trying to say...
The code has to be:
PHP Code:$to="user@server.com";
$subject="Mail Topic";
$message="The mail contents.... blah blah blah...";
$headers ="From: Sender Name <sender@email.address>\r\n";
$headers.="Return-path: email-address@receivingthe.reply\r\n";
$headers.="CC: another@email.tosendto";
mail($to,$subject,$message,$headers);
Real programmers don't document their code - if it was hard to write, it should be hard to understand.
So it is correct but needs the \r\n.
Okay I'll give it another try. Thanks Marshian