Forum Moderators: coopster

Message Too Old, No Replies

Simple Problem Driving Me Nuts!

mail function

         

Tiebreaker

8:56 am on Jun 18, 2005 (gmt 0)

10+ Year Member



Hi

Pretty new to php - I have a form on my site that sends mail to users from me with the following ...

mail($usersemail, $subject, $message, "From: $myemail\r\n"."Reply-To: $myemail");

This works fine - but the message, when it arrives in the persons inbox, will just show my email address in the "From:" field.

How do I get it so that in their inbox, the email says From: MyDomain.com

Thanks in advance and apologies for being dense!

ControlZ

9:01 am on Jun 18, 2005 (gmt 0)

10+ Year Member



What is the name of the php script? Is it one you wrote yourself or one similar to Jack's Formmail.php.

I believe it also depends on the server you are sending mail from as far as the name that appears in the "from" field.

roldar

9:03 am on Jun 18, 2005 (gmt 0)

10+ Year Member



I think I used something like the following to get it to work, but it's been a while.

"From: \"MyDomain.com\" <emailaddress@mydomain.com>\n"

dreamcatcher

9:50 am on Jun 18, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



mail($usersemail, $subject, $message, "From: SiteName<$myemail>\r\n"."Reply-To: SiteName<$myemail>");

dc

Tiebreaker

4:15 pm on Jun 18, 2005 (gmt 0)

10+ Year Member



My thanks to all - especially dreamcatcher, who was spot on!

Problem solved :-)