Jump to content

php mail from function


Giddy Rob

Recommended Posts

Hi,

 

I am having problems with emailing as I want to set an email in the from field but it just uses the server the sites on. I can set up the prefix to the @ but after that its not what I want.

 

How do I specify whatever full email address I want?

 

e.g. I don't want [email protected], I want [email protected]

 

Please Help

 

Cheers

 

Rob

Link to comment
https://forums.phpfreaks.com/topic/57684-php-mail-from-function/
Share on other sites

Try something like this. 

 

$headers="From:Your Display Name<your email [email protected]>\n";

  $headers.="Content-Type:text/html;CHARSET=iso-8859-1\n"; //you can probably try it without this line just for a text message

                   

 

  $subject="subject here";

 

  $msg="message here";

 

                  mail($address,$subject,$msg, $headers); //put the delivery email in $address

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.