Jump to content

Recommended Posts

What am I doing wrong here its on a windows server.

 

mail("$email", "Web Site Question", "test", "From: $name <$email>");

doesn't work

 

mail("$email", "Web Site Question", "test", "From: $email");

works just fine

 

I really need the from name to work.

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 <me@bored.com>\r\nReply-To: me@bored.com\r\nReturn-Path: ime@bored.com";
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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.