Php Email
- Started
- Last post
- 6 Responses
- estetic
I am setting up a contact form for a freelance client. It is working fine on my test server, but as soon as I move it over to the live server it doesnt work at all.
It goes through the motions without any sort of error though (fill out form, click send, variables appear to be passed to php and "thank you" message is displayed). PHP seems to be installed correctly... Do some servers / host have issues with sending email out of PHP or is there something else i should check??
I am using mail (); function.
- mikotondria30
whats it say in your phpinfo ?
- Samush0
your live server may need smtp server
- acescence0
put mail in an if check to see what's happening. it returns bool true on success. turn on error reporting to see what's happening..
error_reporting( E_ALL );
if( mail() ){
// mail was sent
}
- vaxorcist0
is it a windows server?
- estetic0
I somehow managed to bash my way through this right after I made this post. Seems the 'live' server had a issue with my 'from' and 'reply' to headers. Commented them out and got it to work, then adding email addresses with the same domain name did the trick...dunno just glad it is working.
- neverblink0
\r\n for Windows, \n for Unix, \r for Mac - if I recall correctly