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
Post a Comment