vbscript - Fetch an Unread email from a particular address in outlook with VB Script -


i want email address of unread mail particular sender.i tried following code did'nt work

set olapp=createobject("outlook.application") set olmapi=olapp.getnamespace("mapi")  set ofolder = olmapi.getdefaultfolder(6) set allemails = ofolder.items  each email in ofolder.items   if email.unread = true if email.senderemailaddress="kalyanam.raghuram@xxxx.com"  msgbox email.subject   end if end if next 

so checked 'email.senderemailaddress' verifying inserting code

for each email in ofolder.items  if email.unread = true  msgbox email.subject msgbox email.senderemailaddress   end if next 

it gave me output cannot understood readable.please let me know solution it.

dio mean got ex type address instead of expected smtp?

have looked @ _exchangeuser.primarysmtpaddress? in case can use mailitem.sender.getexchangeuser.primarysmtpaddress. prepared handle nulls each value can null.


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -