Jump to content

Archived

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

Rianna

example@linhost122.prod.malibu.secureserver.net

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

Share this post


Link to post
Share on other sites
$to = "recipient@email.com";
$from_address = "sender@email.com";
$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);

Share this post


Link to post
Share on other sites
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 = "recipient@email.com";
$from_address = "sender@email.com";
$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]

Share this post


Link to post
Share on other sites
How about showing us the code that you are currently using, so we can tell you how to change it.

Share this post


Link to post
Share on other sites
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]
?>

Share this post


Link to post
Share on other sites
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]
?>

Share this post


Link to post
Share on other sites

×

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.