How to confirm that mail has been delivered or not?
You can't. Since you use SMTP, in general case, it's impossible to tell whether delivery succeeded or not. Read SMTP specification. Mail is routed while being delivered, so:
- There's no guarantee your message is sent as soon as you call
smtp.Send()
. - Since SMTP is routed, you can't be sure that some node on the route won't fail with delivery to uplink.
How to check if the sent email delivered or not?
I think it is impossible.
Think it as a real life example.
If you send a letter to someone. You also don't know if he will receives it. Unless he calls you and says "hey, i've your letter"
And also, he has to call you, if he has read the letter which sounds strange, don't you think?
It would be all possible if you've a own message service thing, or application like e.g. facebook. They can store the fact that you've opened the "mail" but than it isn't actually a mail but rather a messege to another user. And doesn't use email adresses nor emails
How to check if last email sent was successfully delivered or not using MIME::Lite perl
You don't need to use the eval
block or do anything fancy to ensure that the mail has been sent; that is what last_send_successful
is for. When the send subroutine successfully completes its work, it sets an internal variable ($object->{last_send_successful}
); this is what the last_send_successful
sub is checking. It is usually not necessary to use an eval
block unless you are trying to prevent a script dying or throwing a runtime or syntax error.
You can simplify your code to something like the following:
$msg->send;
if ($msg->last_send_successful) {
# woohoo! Message sent
}
else {
# message did not send.
# take appropriate action
}
or
$msg->send;
while (! $msg->last_send_successful) {
# message did not send.
# take appropriate action
}
How do I know if an email has been delivered using PHP?
You can check it's been sent, but checking it's been delivered is another thing entirely.
In fact, I can't think of any way to confirm it's been delivered without also checking it gets read, either by including a 1x1 .gif that is requested from your server and logged as having been accessed, or a link that the user must visit to see the full content of the message.
Neither are guaranteed (not all email clients will display images or use HTML) and not all 'delivered' messages will be read.
You can of course, monitor your reply-to
address for any bounced mail which will let you say with certainty that a message hasn't been delivered.
Email Delivery Message in Asp.net(how to check whether the email sended?)
On Adding:
message.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure;
Delivery Notification Mail works. But i have to store undelivered mail details in db. How to track that undelivered mails(By Username).
How to check if the mail has been sent successfully
if your SmtpMail.Send(message)
method returns no error, it means the email was sent to the SMTP server, then you are out of your jurisdiction, that is how far you can know.
Related Topics
Using SQLdataadapter to Insert a Row
What Could Be Causing a System.Typeloadexception
"Interface Not Implemented" When Returning Derived Type
Encoding Space Character in Xml Name
Startup.Cs in a Self-Hosted .Net Core Console Application
Having the Output of a Console Application in Visual Studio Instead of the Console
How to Check If a File Exists in a Folder
Enumerating Through an Object's Properties (String) in C#
How to Set the Windows Default Printer in C#
.Net:How to Get the Type of a Null Object
How to Convert Hex to a Byte Array
Wrap Properties with Cdata Section - Xml Serialization C#
C# VS C - Big Performance Difference
Creating a Proxy to Another Web API with ASP.NET Core
How to Pass an Object to Httpclient.Postasync and Serialize as a JSON Body