Check email successful sent and receive

We have a unix/linux server , that send mass email from it , the emails will pass the smtp gateway , email server and sent to the client , but sometimes the client do not receive the mail , we do not know the reason and when it will happen .

We would like to have a script that check when the problem happens , for example send a test mail regularly and check if the client is properly recevied it , so that we can know the problem is happening .

if I want to have such function , how to do it

thanks

What is your definition of mass emailing?
Are you sending 'First Class' mail? That is, the body of every email is different and individually addressed.

Some things that can happen.
Your ISP may block emails from you if you exceed some threshold (maybe 200 per minute).
The recipient may consider your email spam and delete it without reporting it back to you.
Your address book may be out of date.

You might consider using a service like postmarkapp.com.

Javascript has been added to emails to 'call home' when the email is opened, but this is still dependent upon the email client allowing the script to be executed.

What you ask is probably not very practical. For example, you can check to see if you can connect to a remote mail server. But you cannot know what happens to the email once it hits the remote site.

Spam blockers, filters, user settings and all kinds of other things you cannot possibly see may mess up or stall the email. Not to mention the dumb things users do, like delete email and pretend they never got it.

How to check an SMTP connection with a manual telnet session | Port25 Solutions, Inc.

This link shows you how to make a test telnet connect to a remote smtp server on port 25. This is probably the best you can do to validate outgoing email to another server.