Jump to content

Php Mail() Not Sending Mail


jalpro

Recommended Posts

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.

Link to comment
Share on other sites

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 :)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.   Paste as plain text instead

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