Mail Question


#1

I have a question about mail. I used the PHP mail() command and sent an email to my personal account as a test and it comes from:

@.dreamhost.com

I want it to come from my domain email:

admin@mydomain.com

I did some searching and have not found anything. I am at a loss.

How do I do this?

Thanks
Dan


#2

Did you set all the parameters before using the mail() command?

<?php $Name = "Your Name"; //senders name $email = "you@example.com"; //senders e-mail adress $recipient = "yourfriend@example.com"; //recipient $mail_body = "The text for the mail..."; //mail body $subject = "Message Subject"; //subject $header = "From: ". $Name . " <" . $email . ">\r\n"; //optional headerfields mail($recipient, $subject, $mail_body, $header); //mail command :) ?>

It’s that last part, the $header, that should fix your return address.

-Scott


#3

Perfect! Thanks for your quick and accurate response!

I used your syntax and it worked. I had a header but something was wrong with my syntax (not sure what), it showed up in the body.

Thanks again!