Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Automatically check bounced emails via POP3? [closed]

Can anyone recommend software or a .NET library that will check for bounced emails and the reason for the bounce? I get bounced emails into a pop3 account that I can read then.

I need it to keep my user database clean from invalid email addresses and want to automate this (mark user as invalid email).

like image 995
Johannes Avatar asked Aug 10 '08 16:08

Johannes


People also ask

What is an email bounce and how to fix it?

What is an email bounce? An email bounce (or “bounce”) is an error message you get when email you’ve sent isn’t delivered. Your email server or the destination email server sends this Non-Delivery Report (NDR). An email bounce message also informs you what caused delivery failure of your email.

How to track email bounces in SendGrid?

Connect to your SendGrid account, go to Email Reports -> Settings -> Forward bounces. Check the box and enter the forwarding email address which should be your EasyMail7’s return address. In addition to that, you can use the GlockApps tool to track SendGrid bounces and get bounce analytics and downloadable reports.

How can I See which email addresses bounced in a campaign?

To identify which email addresses bounced in a campaign, go to the Delivery Statistics tab and click the option to Export Contacts with Send Status. Important: If you are sending your Email Campaign via your SMTP server, Send Status will not be available via Alchemer.

How do I set up automated bounce (return) processing?

The program will open the account settings in the Bounce Handler and prefill the Login field with your bounce (return) email address. Check the "Check account automatically each hour" option if you want to automate bounced emails processing. Important!


2 Answers

I have done a great deal of work handling bounce emails and there different types. If you want to be absolutely sure that the email your looking at is indeed a bounce of a specific kind I highly recommend getting a good filter. I have worked with Boogie Tools and it has worked very well. It lets you know what kind of bounce it is, Hard, Soft, Transient or if its even someone trying to unsubscribe. It has a muliple API's including .Net and I found it quite easy to get working.

like image 99
Tanerax Avatar answered Nov 04 '22 08:11

Tanerax


It's pretty easy to do with a TcpClient. Open the server:

TcpClient tcpClient = new TcpClient();
tcpClient.Connect(POP3Server, POP3Port);
NetworkStream stream = tcpClient.GetStream();

Read the welcome message:

int read = stream.Read(inBuffer, 0, inBuffer.Length);
string response = Encoding.ASCII.GetString(inBuffer, 0, read);
if (response.IndexOf("+OK") != 0) throw new ...;

Write back to the server:

byte[] outBuffer = Encoding.ASCII.GetBytes("USER " + account + "\r\n");
stream.Write(outBuffer, 0, outBuffer.Length);

That sends the USER command. You need to login and then you can start grabbing messages - see the POP3 RFC for the full list of commands. If you're not looking to roll your own check out this CodeProject article.

like image 45
Robert Ellison Avatar answered Nov 04 '22 09:11

Robert Ellison