Jump to content

Recommended Posts

Hi, does anyone know how to make the form message that comes to my email address contain a different From: address?

The area in our emails where it says Subject:
Date:
From:
To:
I would like the from area to say my own email address, not the long sever address they give me.

Thanks a lot, Jen
$to = "[email protected]";
$from_address = "[email protected]";
$from_name = "Your Name";
$subject = "This is the subject";
$message = "your message here";

$headers .= "From: \"".$from_name."\" <".$from_address.">\n";
mail($to, $subject, $message, $headers);
OK Thanks a lot. I added this per your instructions.

$headers .= "From: \" <".$from_address.">\n";
mail($message, $headers);
$from_address = "myemailaddress@myemailaddress";
$message = $_REQUEST['message'];
mail("myemailaddressagain", "Sent From Form", $headers,""
$message,"" );

This is the only thing I changed in my php code. But now it doesn't work at all. So the error is just in the above part.
Can you see anything wrong with it? Jen

[!--quoteo(post=376945:date=May 25 2006, 04:45 AM:name=wisewood)--][div class=\'quotetop\']QUOTE(wisewood @ May 25 2006, 04:45 AM) [snapback]376945[/snapback][/div][div class=\'quotemain\'][!--quotec--]
$to = "[email protected]";
$from_address = "[email protected]";
$from_name = "Your Name";
$subject = "This is the subject";
$message = "your message here";

$headers .= "From: \"".$from_name."\" <".$from_address.">\n";
mail($to, $subject, $message, $headers);
[/quote]
OK sure, not much more to it. Jen

<?php

$headers .= "From: \" <".$from_address.">\n";
mail($message, $headers);
$from_address = "myemailaddress@myemailaddress";
$message = $_REQUEST['message'];
mail("myemailaddressagain", "Sent From Form", $headers,""
$message,"" );

header( "Location: [a href=\"http://mywebaddress/thankyou.html");\" target=\"_blank\"]http://mywebaddress/thankyou.html");[/a]
?>
you're declaring the message and from_address after the point where you've used them.

This has been tested and works.

<?php
$to = "recipient_email_address";
$from_address = "senders_email_address";
$from_name = "senders_name";
$subject = "subject_of_the_email";
$message = "Message_body_goes_here";

$headers .= "From: \"".$from_name."\" <".$from_address.">\n";
mail($to, $subject, $message, $headers);



header( "Location: [a href=\"http://mywebaddress/thankyou.html");\" target=\"_blank\"]http://mywebaddress/thankyou.html");[/a]
?>

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.