By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,828 Members | 1,223 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,828 IT Pros & Developers. It's quick & easy.

mail from

P: n/a
Hi,
I'm using the mail function to send allow user to send email to a friend
(send to a friend)
mail($friendEmail, $emailSubject, $emailText);

the problem is that when the friend receive the email, he'll see in the FROM
case the server's value (sendmail_from)

How can I put a label like (your friend xxxxx) instead of this.
thanks
Jul 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
toufik toufik wrote:
mail($friendEmail, $emailSubject, $emailText);

the problem is that when the friend receive the email, he'll see in the FROM
case the server's value (sendmail_from)


http://www.php.net/manual/en/function.mail.php

--
Jock
Jul 17 '05 #2

P: n/a
toufik toufik wrote:
Hi,
I'm using the mail function to send allow user to send email to a friend
(send to a friend)
mail($friendEmail, $emailSubject, $emailText);

the problem is that when the friend receive the email, he'll see in the FROM
case the server's value (sendmail_from)

How can I put a label like (your friend xxxxx) instead of this.
thanks


In the additional headers parameter (which comes right after the email
body parameter), add "From: email_goes_here\r\n".

It should look like:

mail($friendEmail, $emailSubject, $emailText, "From: $senderEmail\r\n");

HTH
-Jay

Jul 17 '05 #3

P: n/a
Thanks, i've used the header parameter and it works
"Jay Moore" <ad*****@isp.tld> wrote in message
news:48*******************@twister.rdc-kc.rr.com...
toufik toufik wrote:
Hi,
I'm using the mail function to send allow user to send email to a friend
(send to a friend)
mail($friendEmail, $emailSubject, $emailText);

the problem is that when the friend receive the email, he'll see in the FROM case the server's value (sendmail_from)

How can I put a label like (your friend xxxxx) instead of this.
thanks


In the additional headers parameter (which comes right after the email
body parameter), add "From: email_goes_here\r\n".

It should look like:

mail($friendEmail, $emailSubject, $emailText, "From: $senderEmail\r\n");

HTH
-Jay

Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.