Changing the sender in the mail() function

the mail() function

Moderators: macek, egami, gesf

daimler
New php-forum User
New php-forum User
Posts: 2
Joined: Tue Feb 04, 2003 11:35 pm

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.

User avatar
Redcircle
Moderator
Moderator
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA
Contact:

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);

daimler
New php-forum User
New php-forum User
Posts: 2
Joined: Tue Feb 04, 2003 11:35 pm

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.


Return to “PHP coding => Mail”

Who is online

Users browsing this forum: No registered users and 1 guest

cron