15-02-22 04:50 PM
Answered! Go to Answer.
17-02-22 03:33 PM
dim recips as object, recip as object, PA as object, Eid as string
Eid = ""
Const PR_SMTP_ADDRESS as string = "http://schemas.microsoft.com/mapi/proptag/0x39FE001E"
recips = item.Recipients
for each recip in recips
PA = recip.PropertyAccessor
Eid = Eid & ";<" & PA.GetProperty(PR_SMTP_ADDRESS) & ">"
next
If Left(Eid,1) = ";" then
Eid = Right(Eid, Len(Eid)-1)
end if
row("To") = Eid
15-02-22 05:55 PM
16-02-22 03:37 PM
16-02-22 11:54 PM
Private Function GetSenderSMTPAddress(ByVal mail As Outlook.MailItem) As String
Dim PR_SMTP_ADDRESS As String = "http://schemas.microsoft.com/mapi/proptag/0x39FE001E"
If mail Is Nothing Then
Throw New ArgumentNullException()
End If
If mail.SenderEmailType = "EX" Then
Dim sender As Outlook.AddressEntry = mail.Sender
If sender IsNot Nothing Then
If sender.AddressEntryUserType = Outlook.OlAddressEntryUserType.olExchangeUserAddressEntry OrElse sender.AddressEntryUserType = Outlook.OlAddressEntryUserType.olExchangeRemoteUserAddressEntry Then
Dim exchUser As Outlook.ExchangeUser = sender.GetExchangeUser()
If exchUser IsNot Nothing Then
Return exchUser.PrimarySmtpAddress
Else
Return Nothing
End If
Else
Return TryCast(sender.PropertyAccessor.GetProperty(PR_SMTP_ADDRESS), String)
End If
Else
Return Nothing
End If
Else
Return mail.SenderEmailAddress
End If
End Function
You'll need to add a line or two to the code stage in the Internal_Get_Items action to make a call the above function. Just pass in the mail item and you should get back the SMTP email address. Below is a screenshot of where I might add the line to call the above function.
16-02-22 11:59 PM
17-02-22 11:28 AM
17-02-22 11:43 AM
Hi @MohammadNaveed,
In your scenario the name found in the TO address doesn't match the actual Exchange "Display Name" for the user? I suppose the question is whether that name value shows up under any other property in the Exchange entry of that user? If it does than you should be able to query that property. If it doesn't, I imagine you'd need to add some code to normalize the name to the appropriate format before calling the conversion function. In other words, if the failing names are always Surname, Given Name you could queue off the comma, swap the names, and call the function again.
Does that make sense?
Cheers,
17-02-22 03:33 PM
dim recips as object, recip as object, PA as object, Eid as string
Eid = ""
Const PR_SMTP_ADDRESS as string = "http://schemas.microsoft.com/mapi/proptag/0x39FE001E"
recips = item.Recipients
for each recip in recips
PA = recip.PropertyAccessor
Eid = Eid & ";<" & PA.GetProperty(PR_SMTP_ADDRESS) & ">"
next
If Left(Eid,1) = ";" then
Eid = Right(Eid, Len(Eid)-1)
end if
row("To") = Eid