Processing Bounced Emails

Status
Not open for further replies.

Eric1805

New Member
Outlook version
Email Account
Exchange Server
I'm trying to create a VB function to generate a list of email address from bounced replies I've recieved without having to parse through the entire email body. From a "human" standpoint, this seemed easy; select the email, click on "Reply All" and the resulting email contains the info I need in the To: field. Ironically, if I first open the email, there is no "Reply All" option and the best i can tell all the VB code i've found over the last 2 days acts like this. Even without the Reply All from the main Outlook menu, I can see the email address(es) that bounced in the "To" column in my folder view...just can't figure out how to read that data. FYI, i'm on Outlook 2007.

Any ideas?
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange

Eric1805

New Member
Outlook version
Email Account
Exchange Server
No...as it happens i've copied all the bounced replies to a specail folder for processing.

I'm trying to generate a list of the email addresses I sent the original emails to without having to parse the bounced email. I saw a suggestion via Google that looked simple...loop through the folder, "Reply All" to each bounce email, extract the .Recipients, close the email. The first problem i ran into was the through VBA there didn't seem to be a "Reply All" (i got errors). As is dug into this and finally tried doing some things "manually", i discovered an odd thing (and the source of my question). When i'm in an Outlook folder looking at the list of bounced emails, i can select one and i see a "Reply All" button on the main Outlook menu that does exactly what i want (generates a new email item will the proper Recipients listed). BUT, if i first open the bounced email, i DON'T have a "Reply All" menu option. So, the VBA Reply All seems to act like the Open | Reply All. I was wondering if there was any VBA that would mimic the Reply All from the main Outlook menu. FYI, I first tried this using a "For Each MailItem in BouncedFolder" structure. Out of frustation i changed the code to a Do While working with .Selected items, but the results were the same.
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
You can call reply all, but you don't need to do that to get the recipients list. Are the bounced addresses in the address field or in the message body? Most NDRs put the bad addresses in the body:

Delivery has failed to these recipients or groups:
address@domain.com

The macro I posted earlier looks for matching contacts but can easily be tweaked to do anything - this is the code block that "does something" and is what would be replaced.

Code:
Set myItem = myContacts.Find("[Email1Address]=" & strAddress) 
      
       If TypeName(myItem) = "ContactItem" Then 
          If Not TypeName(myItem) = "Nothing" Then 
            myItem.Categories = myItem.Categories & ";Delete" 
                Debug.Print strAddress & " Delete" 
            myItem.Save 
         End If 
        End If

If the addresses really are in the to/cc field, this macro can be used: http://www.slipstick.com/developer/recipient-email-address-sent-items/

It adds the addresses to a new field in the folder but it can be tweaked to do something else with them, or you can copy the field and paste into Excel to work with them. (Remove all other fields from the view, then select all, copy and paste)
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
C Email bomb processing Outlook VBA and Custom Forms 1
C Outlook 2007 Removing then adding account restores junk email processing Using Outlook 0
T "Words In Recipient's Address" Rule Causes Outlook To Stop Processing Rules Using Outlook 3
Peter H Williams How to Move Mail item after processing Outlook VBA and Custom Forms 5
B When I add more search strings to RULES, it is not processing them Using Outlook 3
E Outlook Form - Voting Responses Not Auto Processing If Form Contains Any Code Outlook VBA and Custom Forms 0
A Processing Incoming E-mails with Macros Using Outlook 0
M Outlook 2016 Desktop - Automatic Rule Processing Using Outlook 3
K Outlook 2013 stuck "processing" when opening. Using Outlook 3
J Data Processing Using Outlook 3
A Pull mail without marking and processing, only by selecting it Using Outlook 1
L VBA Processing of Active E-Mail Message Outlook VBA and Custom Forms 2
J Outlook not processing all incoming emails Outlook VBA and Custom Forms 3
T read receipts while processing emails Outlook VBA and Custom Forms 5
A Processing Email Messages in .pst, changing email addresses Outlook VBA and Custom Forms 5
J Auto processing of incoming mail Outlook VBA and Custom Forms 1
J Auto processing of incoming mail Outlook VBA and Custom Forms 1
J Outlook 365 Emails showing as links and text only Using Outlook 4
G Removing old emails when adding accounts Using Outlook 3
N VBA Macro To Save Emails Outlook VBA and Custom Forms 1
Horsepower Lost emails Using Outlook 4
P Emails assigned with a certain category (within a shared inbox) to be copied to a specific folder. Outlook VBA and Custom Forms 2
M Saving emails using Visual Basic - Selecting folder with msoFileDialogFolderPicker Outlook VBA and Custom Forms 6
L Emails being archived when I press the A key accidentally - how do I stop this? Using Outlook 0
N Save emails within a certain date range to network drive Outlook VBA and Custom Forms 0
M I cant send emails via Outlook in my W10 PC. Using Outlook 3
e_a_g_l_e_p_i Can emails from Gmail be deleted when they are downloaded to Outlook 2010 Using Outlook 1
D Wrong email address in Outlook 2003 "From" tab in new outgoing emails Using Outlook 4
witzker How to find all emails from and to a contact in OL 2019 Using Outlook 6
S How to find emails that I sent that have not received a reply? Using Outlook 7
M Extract "Date sent" from emails (saved to folder using drag and drop) Outlook VBA and Custom Forms 1
R Sent emails show iCloud mail account not the alias Using Outlook 2
K Run a script rule to auto 'send again' on undeliverable emails? Outlook VBA and Custom Forms 1
J how to stop junk emails from *.onmicrosoft.com ? Using Outlook 2
FryW Need help modifying a VBA script for in coming emails to auto set custom reminder time Outlook VBA and Custom Forms 0
S Auto forward for multiple emails Outlook VBA and Custom Forms 0
M All fonts in Outlook emails display with exaggerated character spacing Using Outlook 3
L Images not displaying in emails sent to self Using Outlook 2
C Icons (arrows) not showing on emails forwarded or replied to Using Outlook 8
R Moved 6 months worth (approx 1500 emails) lost from moving from TPG inbox to Icloud inbox (folders) Using Outlook 3
U Approving Emails from iPhone Using Outlook 0
D cannot view emails in View pane (in the right pane), I only see one line or nothing Using Outlook 21
A Macro to file emails into subfolder based on subject line Outlook VBA and Custom Forms 1
N Help creating a VBA macro with conditional formatting to change the font color of all external emails to red Outlook VBA and Custom Forms 5
B Outlook 2016 Unable to view images or logos on the outlook 2016 emails the same html code works well when i use outlook 2010 Using Outlook 0
A Record opened emails for reopening later Using Outlook 2
Y Filter unread emails in a search folder vba help Outlook VBA and Custom Forms 0
S Outlook 2016 Change how Outlook shows me contacts in emails Using Outlook 0
T Outlook creating unwanted tasks in Tasks and Todo from emails Using Outlook 1
B Outlook 2016 Outlook crashes when trying to print certain emails Using Outlook 5

Similar threads

Top