Page 1 of 1

mail() function

Posted: Fri Oct 16, 2009 6:58 am
by synical21
Hello code gurus,

Thanks for reading.

Re: mail() function

Posted: Fri Oct 16, 2009 8:21 am
by Eric!
So did their example work for you?

Depending on your mail server you might need to make sure each line is terminated with \r\n

You also might need to split the message for SMTP to be happy
$message=chunk_split(base64_encode($message),70)

Also you might try echoing back the fields you are dumping into mail() using echo htmlentities($yourvariable) to see what is in there.

You can also try my example on your server and see how that runs (it will also show you how to protect yourself from hackers)
viewtopic.php?f=50&t=104240

Your script is also vulnerable to SQL injection where you pass raw POST values into the database. ALL of your user fields should be filtered before you do anything with them. There are several other areas where you directly use the user data in your script.

Also you might need to enable error checking to see what errors you are getting

Code: Select all

ini_set('display_errors',1);
error_reporting(E_ALL|E_STRICT);

Re: mail() function

Posted: Fri Oct 16, 2009 8:42 am
by synical21
your example looks good ill try implement it now into my script, if i just change variables and fiddle with the settings it should work, it looks really user friendly well done