I have to send messages to many clients. But many of them bounce back. I want a list of those email addresses. How can I get that list from my Java application?
What causes an email to bounce back? There are a variety of reasons for email bounce backs include full inboxes, servers that aren't responding, sends to email addresses that no longer exist, invalid email addresses, and sends to fake email addresses.
Emails sent to incorrect or invalid email addresses are likely to bounce. If an address entered during sign up includes typos or emissions, the email will bounce because the address doesn't exist.
Make a special email address [email protected] where you will capture all bounced emails for analysis.
Add the following header to your sent emails:
Return-Path: <[email protected]>
Now the emails are going to bounce back to that address.
Read emails at that address from your java program from time to time, for example via IMAP (or depending on your server via a notification interface/whatever), and when you see an email address record it in your database
Note that if you are doing a newsletter app, you should not blacklist the email from the first time, but make count it's bounces, and blacklist it after 3-4 bounces (some people set their email to bounce when they go in vacation and such, so they need special taking care of).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With