Jump to content


Photo

example@linhost122.prod.malibu.secureserver.net


  • Please log in to reply
6 replies to this topic

#1 Rianna

Rianna
  • Members
  • PipPip
  • Member
  • 23 posts

Posted 25 May 2006 - 08:57 AM

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


#2 wisewood

wisewood
  • Members
  • PipPipPip
  • Advanced Member
  • 226 posts
  • LocationRotherham, England

Posted 25 May 2006 - 09:45 AM

$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);
wisewood: proven fact, I am both wise, and wooden.

#3 Rianna

Rianna
  • Members
  • PipPip
  • Member
  • 23 posts

Posted 25 May 2006 - 11:14 AM

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) View Post[/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]


#4 Crimpage

Crimpage
  • Members
  • PipPipPip
  • Advanced Member
  • 70 posts
  • LocationBrisbane, Australia

Posted 25 May 2006 - 11:19 AM

How about showing us the code that you are currently using, so we can tell you how to change it.

#5 Rianna

Rianna
  • Members
  • PipPip
  • Member
  • 23 posts

Posted 25 May 2006 - 11:31 AM

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]
?>

#6 wisewood

wisewood
  • Members
  • PipPipPip
  • Advanced Member
  • 226 posts
  • LocationRotherham, England

Posted 25 May 2006 - 12:13 PM

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]
?>
wisewood: proven fact, I am both wise, and wooden.

#7 Rianna

Rianna
  • Members
  • PipPip
  • Member
  • 23 posts

Posted 25 May 2006 - 11:44 PM

Got it! Thanks.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users