Collecting data from ms outlook
Hello everyone, I am here to ask if how can I collect data coming from ms outlook. What I want is that i need a program that will collect the email address of the bounced-back emails and the reason why they bounce. Is it possible? If yes then how can i do it? If no, then I have another options I am using Mail Them Pro program for email marketing, how can i get their data like for example if the mail are sent successfully or not? Hope to get a solution for this problem. Have nice day everyone.
Re: Collecting data from ms outlook
Use the outlook references and search for internet samples.
http://www.codenewsgroups.net/group/...topic3009.aspx
Re: Collecting data from ms outlook
Thanks zynder....Have a nice day and God Bless..
Re: Collecting data from ms outlook
I haven't tested it but this should work...
vb Code:
Private Sub Application_NewMail()
'~~> We will checking for this string in the subject
strChk = "Delivery Status Notification (Failure)"
On Error Resume Next
Set oFolder = GetNamespace("MAPI").GetDefaultFolder(olFolderInbox)
On Error GoTo 0
For Each oNewItem In oFolder.Items.Restrict("[Unread] = 0")
subj = oNewItem.Subject
Ebody = oNewItem.Body
If InStr(1, subj, strChk) > 0 Then
'~~> the email address is stored like this
pos1 = InStr(1, Ebody, "To: <")
pos2 = InStr(pos1, Ebody, ">")
If pos1 > 0 Then
'~~> This will give you the email address
MsgBox Mid(Ebody, pos1 + 5, pos2 - pos1 + 1)
End If
End If
Next
End Sub
Edit: Similarly, you can get the reason why they bounce :) If you get stuck let me know... we will get this sorted...