Jump to content

Recommended Posts

Posted

For future reference, does php mail() only work on Linux servers? Or is it just the way that this host has set up their Windows server?

 

 

 

 

PHP mail works on any platform, if you have it configured correctly. The problem (sadly) is not windows; the problem is that they have not configured the server correctly.

Posted

Is there a proper way to write the From and Reply-to headers for an email?

The email from my form is coming through as "postmaster@domain.com" rather than the email I used in the headers.

 

This is the code I was using before:

$headers = "From: $email\r\n";
$headers .= "Reply-to: $email";

 

Then I Googled it and saw a post that said it had to be in the ' "Name" <email> ' format.

I changed my code to the following, ignoring Reply-to for the time being:

$headers = "From: \"".$contactname."\" <".$contactemail.">\n";

But that code didn't work either.

 

Any ideas?

Thanks :)

Posted

Like this and it's a good idea to send a content type header:

 

$headers  = "From: $name <$email>\n";
$headers .= "Reply-to: $name2 <$email2>\n";
$headers .= "Content-Type: text/plain; charset=iso-8859-1\n";

Posted

I put in those headers.

But for some reason, the email doesn't sent with headers.

It works fine if it's just:

mail($to, $subject, $body);

Posted

Then I Googled it and saw a post that said it had to be in the ' "Name" <email> ' format.

I haven't actually looked this up to verify it, but I seem to remember something about crappy windows servers requiring "Name" <email@address.com> type format.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...