Page 1 of 1

php mail() function assumed to be spam

Posted: Sat Sep 23, 2006 11:18 am
by jolinar
I'm not sure if this problem can be resolved or whether I'm not coding this right, but all messages generated by php's mail() function are assumed to be spam. this isn't a problem when contacting a provider with a bulk mail folder (like the yahoo account I sometimes), problem is that my primary account seems to throw the messages away. Does anyone know how to make the messages seem more "human"? (Please remember that I'm NOT using this for spam, it's part of a password generating script I'm working on. Here is the code in question:

Code: Select all

$subject = "User Password For $user_name_reset";
$message = "This is an automated message.  If you did not intend to recieve it, please ignore it.\n\nYou requested your password to be reset and/or confirmation of your username.\n\nUsername: $user_name_reset\nPassword: $pass\n\nRegards, Dan";
$headers = 'From: Hades';
mail($email_reset,$subject,$message,$headers);
			
print "<p>Your username/password has been e-mailed to you.  Please check the account you used to register</p>\n";
Also, the messages appear as being from: Hades@ localhost.localdomain
I think this is because I'm hosting it on a dedicated linux with dynamic DNS, can I change that name by altering the /etc/hosts file?

Posted: Sat Sep 23, 2006 11:41 am
by feyd
Spam flags go up usually in response to the headers you use (or don't use, in some cases) and the content of your message hitting certain words or being composed in various ways.

If you don't fully understand how email works, or just don't care to, we'll likely suggest using a mailing library such as Swift.

Of course, if your server is a dynamic IP or is blacklisted for some reason, it's likely that even a library will be unable to help you in that regard.

Posted: Sun Sep 24, 2006 7:01 am
by jolinar
I guess that makes testing a little more complicated. Thanks anyway