Hi, all.. i have a big problem here. I wish to send email through the php script.. but i don know what's wrong with it. it stated there email sent.. but i cannot receive any email. Can anybody tell me what probably did i do wrong? is it that i need to install other thing to run smtp? below is my test script which i use to test send the email. <?php //define the receiver of the email $to = 'email address here'; //define the subject of the email $subject = 'Test email'; //define the message to be sent. Each line should be separated with \n $message = "Hello World!\n\nThis is my first mail."; //define the headers we want passed. Note that they are separated with \r\n $headers = "From:(E-Mail address blocked: See forum rules)\r\nReply-To: sender email address here"; //send the email $mail_sent = @mail( $to, $subject, $message, $headers ); //if the message is sent successfully print "Mail sent". Otherwise print "Mail failed" echo $mail_sent ? "Mail sent" : "Mail failed"; ?> PHP: after i run the script, the browser showing Mail sent. but when i check my email account, i did not receive any of this email.
I am only seeing one problem which azizny has mentioned. Remove @ from line: $mail_sent = @mail( $to, $subject, $message, $headers );
Maybe your smtp server request authorization, before you send email? Did you try to send email without headers, to see if it will pass?
I've tried every thing but still the same.. can i ask what should i put in php.ini file for this : SMTP = I am currently putting it as SMTP = smtp.streamyx.com. coz in malaysia, i m using streamyx isp now.. is it correct?.. i really have no idea what to put there..
No, that is just address of your smtp server. If it is on same server like your web server, it will works with: SMTP = localhost But it is possible that sendmail(I suppose that your company is using it), you might need to enter location of it: sendmail_path = Also it could be possible that your hosting company use differnt smtp server(like postfix. I suggest you to contact them and ask for details how to send emails from php. But I still think that it might be due to authorisation issue. Thanks, Ivica
There are could be delivering problems if you have wrong DNS configuration. For example Hotmail, Yahoo and AOL require you to have reverse DNS properly configured. Some more
It doesn't matter if he wants to hide the error messages, he's using a variable to detect if it is sent or not anyways. The message "Message Failed" should print if there was an error and the thread starter said he gets "Message Sent". If he removes @ I bet he'll get the same result. I suggest you check your spam box. Still if it's not there, send the message to different addresses using a different providers. If non of them were able to receive the message, you should contact your hosting provider.