Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => Mail

Changing the sender in the mail() function

the mail() function

Moderators: macek, egami, gesf

Changing the sender in the mail() function

Postby daimler » Wed Feb 05, 2003 12:36 am

I have read the documentation about how to use the mail() function. my problem is that I can't change the sender parameter. Is there a way to change it? Or is there a module or function where I can use dynamic mail() senders? We have our own Apache server.
daimler
New php-forum User
New php-forum User
 
Posts: 2
Joined: Tue Feb 04, 2003 11:35 pm

Postby Redcircle » Wed Feb 05, 2003 4:10 pm

the from address is defined in the header. example

Code: Select all
$fromName = "from";
$fromEmail = "from@metoyou.com";

$toName = "recipient";
$toEmail = "to@metoyou.com";

$message = "This is a test";
$subject = "testing email";

$headers = "From: ".$fromName." <".$fromEmail.">\r\n";

mail($toEmail, $subject, $message, $headers);
User avatar
Redcircle
Moderator
Moderator
 
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA

Changing the sender in the mail() function

Postby daimler » Wed Feb 05, 2003 4:41 pm

Thanks, RedCircle, but that's not what I mean. That header appears only inside the body of the email that will be sent. The sender parameter that I'm refering to is the sender that will appear in the inbox of my emails destination, not the body of the email.
daimler
New php-forum User
New php-forum User
 
Posts: 2
Joined: Tue Feb 04, 2003 11:35 pm


Return to PHP coding => Mail

Who is online

Users browsing this forum: No registered users and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.