how do i change what is displayed in the "from" email field

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
arcmedia
Forum Newbie
Posts: 2
Joined: Tue Jun 10, 2008 11:09 am

how do i change what is displayed in the "from" email field

Post by arcmedia »

Hey guys I'm new to this great community and tried to do research on this prior to posting here. I actually called ipower support cause i thought it was server issue and tech support told me to "google it."

I've developed a flash form that works with php to do a simple send to a friend or mailing sign up form that would then be emailed to the user inputed information. My issue is that when the user receives the resulting email it will come from an undesired email alias that is not related to my domain. Has anyone experienced this issue? and how could i go about controlling what the "from" field displays?

Thanks in advance!

example of my "send to a friend" php script below being called from flash.

Code: Select all

 
<?
$msg = "Hey, check out myurl.com.";
$to = "$sender_email";
$subject = "$sender_name has recommended a site for you.\n\n ";
$mailheaders = "Sent from myurl.com \n";
mail($to, $subject, $msg, $mailheaders);
?>
 
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Re: how do i change what is displayed in the "from" email field

Post by superdezign »

I believe that 'Sender' and 'Reply-To' would be the mail headers that you would be interested in. Maybe checking the PHP documentation of the mail() function will prove useful in showing you how to use headers.
arcmedia
Forum Newbie
Posts: 2
Joined: Tue Jun 10, 2008 11:09 am

Re: how do i change what is displayed in the "from" email field

Post by arcmedia »

cool thanks for the tip :D
Post Reply