Highlighted
New Member.
272 views

Unable to verify sender's email address in outlook through UFT

With the below code i am not able to verify sender email address (abc.de@mini.com) in outlook through UFT.

It is giving error at line 'A'(shown below).

Error Message: unable to parse abc.de@mini.com

Note: able to verify the email addresses of type "abc@mini.com" but unable to validate email addresses of type "abc.de@mini.com" or "abc@mini.co.in"

Function VerifyEmailNotification(ByVal strMailFrom,ByVal strSubject,ByVal strBody)

Set objOutlook= CreateObject("Outlook.Application")
objOutlook.ActiveWindow

Set OutlookSetNameSpace = objOutlook.GetNamespace("MAPI")

OutlookSetNameSpace.Logon
OutlookSetNameSpace.SendAndReceive(True)
Set OutlookSetFolder = OutlookSetNameSpace.GetDefaultFolder(6) ' 6 for Inbox folder

Set objAllMails= OutlookSetFolder.Items
MailProperty="From"
MailPropertyValue= strMailFrom

Set ObjFilteredMails=objAllMails.Restrict("[" & MailProperty & "] = " & MailPropertyValue) ---------A
FilteredMailCount = ObjFilteredMails.Count
index=FilteredMailCount 'Recent mail

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.