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 Macro to Reply to Emails w/ Template Outlook VBA and Custom Forms 3
G Save emails as msg file from Outlook Web AddIn (Office JS) Outlook VBA and Custom Forms 1
T Outlook 2010 Sub accounts not showing new emails in Inbox Using Outlook 4
Nufc1980 Outlook "Please treat this as private label" auto added to some emails - Help. Using Outlook 3
humility36 Cannot move emails to archive - 440 error Outlook VBA and Custom Forms 1
E Edit incoming emails to remove a certain sentence added by the "system" Using Outlook 1
R Saving Emails and Attachments as .msg file Using Outlook 3
F Color code certain INBOX emails Using Outlook 2
J gmail and deleted emails. Using Outlook 0
Z Outlook 2021 Outlook new emails notification not working Using Outlook 4
J Outlook 365 Outlook Macro to Sort emails by column "Received" to view the latest email received Outlook VBA and Custom Forms 0
C Outlook 365 Copy/Save Emails in Folder Outside Outlook to Show Date Sender Recipient Subject in Header Using Outlook 0
U Outlook not responding when trying to print Emails Using Outlook 5
K mark emails with colour manually (like in thunderbird) Using Outlook 1
richardwing Outlook 365 VBA to access "Other Actions" menu for incoming emails in outlook Outlook VBA and Custom Forms 0
U Outlook on the iPhone cannot approve filtered Emails Using Outlook 0
K Outlook 365 After migrating to Outlook 365, some contacts display in emails with prefixes Using Outlook 0
B Move emails from one account to another Outlook VBA and Custom Forms 2
D Unable to view older emails in desktop app Using Outlook 0
S Outlook 365 Help me create a Macro to make some received emails into tasks? Outlook VBA and Custom Forms 1
R Outlook 2021 Having problem setting up outlook 2021 with windows 11. I have 3 gmail accounts and I want the 3 gmail, emails to merge into the same outlook input. Using Outlook.com accounts in Outlook 0
S Outlook 2021 Can you make emails from 3 word domains "safe" by entering top 2 word domain into Safe List in Outlook? Using Outlook 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

Similar threads

Top