Jump to content

[SOLVED] mail help


dare87

Recommended Posts

I am trying to send a message using php, but my server keeps overriding the header.

 

I try and it is changed

 

$headers = "From: [email protected] \r\n";

 

but if I try I get Parse error: syntax error, unexpected T_STRING

 

$headers = "From: "test" <[email protected]> \r\n";

 

am I missing something?

 

Thanks

 

 

Link to comment
https://forums.phpfreaks.com/topic/94825-solved-mail-help/
Share on other sites

this shuld help you out take a look at this code and then either use instead of your own or use it to help fix your own wot ever you decide

 

<?PHP

$to = "YOUR EMAIL ADDRESS HERE";

$subject = $_POST["title"];

$name = $_POST["name"]

$message = $_POST["message"];

$messagesent = "From: $name Message: $message";

$from = $_POST["email"];

$headers = "From: $from";

mail($to,$subject,$messagesent,$headers);

echo "Your message has been sent, thank you.";
?>

Link to comment
https://forums.phpfreaks.com/topic/94825-solved-mail-help/#findComment-485759
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.