Jump to content

Recommended Posts

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...  :shrug:

 

It says successfully sent when enter it in a page, but when I check my email, nothing is there.

 

What else could it be?

Link to comment
https://forums.phpfreaks.com/topic/180296-mail-says-sent-but-no-email-received/
Share on other sites

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.

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.

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

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.