Ty44ler Posted November 4, 2009 Share Posted November 4, 2009 My code is quite simple: <?php $to = "Ty44ler@yahoo.com"; $subject = "Test mail"; $message = "Hey, I just wanted to see if the script worked."; $from = "Ty44ler@yahoo.com"; $headers = "From: $from"; if (mail($to,$subject,$message,$headers)) { echo("<p>Message successfully sent!</p>"); } else { echo("<p>Message delivery failed</p>"); } ?> I have the SMTP server correct in the php.ini file as well as the port as it connects fine when I do a telnet. Also checked the spam folder and nothing there... It says successfully sent when enter it in a page, but when I check my email, nothing is there. What else could it be? Quote Link to comment https://forums.phpfreaks.com/topic/180296-mail-says-sent-but-no-email-received/ Share on other sites More sharing options...
lemmin Posted November 4, 2009 Share Posted November 4, 2009 Is it a local SMTP or are you connecting to a different server? Quote Link to comment https://forums.phpfreaks.com/topic/180296-mail-says-sent-but-no-email-received/#findComment-951168 Share on other sites More sharing options...
PFMaBiSmAd Posted November 4, 2009 Share Posted November 4, 2009 A TRUE value from the mail() function just means that there was a mail server and it accepted the email without returning an error to php. It does not mean that the mail was sent or that the mail server has any intention of sending it. A lot of mail servers have been configured to 'silently' accept emails that they have no intention of sending and are not giving back error messages because those message give hackers information about the mail server and also tend to confirm which email addresses are valid on the mail server and which as not. You should look into the MTA queues and logs to find out what is happening to the emails, if they are being discarded for some reason or if they are actually being send and the problem is occurring at the receiving mail server. Quote Link to comment https://forums.phpfreaks.com/topic/180296-mail-says-sent-but-no-email-received/#findComment-951178 Share on other sites More sharing options...
Ty44ler Posted November 5, 2009 Author Share Posted November 5, 2009 Is it a local SMTP or are you connecting to a different server? The files are on the same server as the SMTP. A TRUE value from the mail() function just means that there was a mail server and it accepted the email without returning an error to php. It does not mean that the mail was sent or that the mail server has any intention of sending it. A lot of mail servers have been configured to 'silently' accept emails that they have no intention of sending and are not giving back error messages because those message give hackers information about the mail server and also tend to confirm which email addresses are valid on the mail server and which as not. Ahh, I see a bunch of emails in the queue folder. How do I configure the server so it sends the emails? I looked up some stuff online, but nothing really seems to say what to do. I'm using the IIS SMTP service by the way. Quote Link to comment https://forums.phpfreaks.com/topic/180296-mail-says-sent-but-no-email-received/#findComment-951916 Share on other sites More sharing options...
Ty44ler Posted November 5, 2009 Author Share Posted November 5, 2009 Here's a bit of my SMTP log file: #Software: Microsoft Internet Information Services 6.0 #Version: 1.0 #Date: 2009-11-05 20:20:57 #Fields: date time c-ip cs-username s-sitename s-computername s-ip s-port cs-method sc-status sc-win32-status time-taken 2009-11-05 20:20:57 SMTPSVC1 0 HELO 250 0 0 2009-11-05 20:20:57 SMTPSVC1 0 MAIL 250 0 0 2009-11-05 20:20:57 SMTPSVC1 0 RCPT 250 0 0 2009-11-05 20:20:57 SMTPSVC1 0 DATA 250 0 0 2009-11-05 20:20:57 SMTPSVC1 0 QUIT 240 15 0 Quote Link to comment https://forums.phpfreaks.com/topic/180296-mail-says-sent-but-no-email-received/#findComment-952008 Share on other sites More sharing options...
Ty44ler Posted November 6, 2009 Author Share Posted November 6, 2009 Anyone got an idea? Quote Link to comment https://forums.phpfreaks.com/topic/180296-mail-says-sent-but-no-email-received/#findComment-952538 Share on other sites More sharing options...
PFMaBiSmAd Posted November 6, 2009 Share Posted November 6, 2009 There should be two sets of SMTP commands for each email. One set where your web server/php makes a connection to your mail server for the purpose of giving it the email to send and a second set where your mail server makes a connection to the recipient mail server to actually send the email to the final destination. Quote Link to comment https://forums.phpfreaks.com/topic/180296-mail-says-sent-but-no-email-received/#findComment-952636 Share on other sites More sharing options...
Ty44ler Posted November 6, 2009 Author Share Posted November 6, 2009 I don't think I quite understand what you're telling me. I should have another set of code for outbound traffic too? like in the php? or are you saying there should be more to my logfile? Quote Link to comment https://forums.phpfreaks.com/topic/180296-mail-says-sent-but-no-email-received/#findComment-952647 Share on other sites More sharing options...
Ty44ler Posted November 6, 2009 Author Share Posted November 6, 2009 Well, I got it figured out. It's getting blocked by the spam filter. Since the email domain is different than the ip of the server the files are hosted on it thinks of it as a bot and blocks it. Thanks for you help anyway! Quote Link to comment https://forums.phpfreaks.com/topic/180296-mail-says-sent-but-no-email-received/#findComment-952691 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.