Jump to content

php mail from name not working on windows server


project3

Recommended Posts

I can't tell you why your From name doesn't work.

When I was using a windows server to send mail, I had to use:

ini_set("SMTP","mail.yourdomain.com");
ini_set("smtp_port","25");


The standard format for sending mail through php's mail function is:

$to = $email;
$subject = 'This is email, duh';
$message = 'I want to go home.';
$headers = "From: me <[email protected]>\r\nReply-To: [email protected]\r\nReturn-Path: [email protected]";
mail( $to, $subject, $message, $headers );

 

My server requires that the 'from' address be an existing address (on my server) for the from name to work. If I try to use an address that doesn't exist, or one that is not on my server, the actual address comes through instead. Maybe your host is set up the same way. So if the from email address in question doesn't exist, then try creating it and then sending the mail again and seeing what happens.

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.