cancel
Showing results for 
Search instead for 
Did you mean: 

MAPIEx - SenderEncoded vs SenderEmail

JoakimEklund
Level 6
Hi, Our team has come across an issue with the "Reply To Mail" action. Sometimes the "SenderEncoded" property returns "email.example@email.com " which results in failure to reply to the mail. Whilst the "SenderEmail", to my limited knowledge on the subject, does not return the email again surrounded with "". The code of the "Reply To Mail" action: reply.AddRecipients(RecipientType.TO, msg.SenderEncoded) My question is, what difference is it between the two properties "SenderEncoded" and "SenderEmail"? Which one is favoured to use? I was thinking of modifying the action to something like this to ensure that the sender is indeed the correct one: Dim theSender As String = msg.SenderEncoded If InStr(theSender, "") > 0 Then ValidSender= True Else ValidSender ="false End If And then throw an exception. I would like some clarification before proceeding. It is, of course, high importance that any mailing is done securely and properly. Best Regards, Joakim
1 REPLY 1

JoakimEklund
Level 6
I think the solution below is a valid solution, I'd love some feedback: ' msg.From => reply.To Dim theSender As String = msg.SenderEncoded 'Store the ""SenderEncoded"" If InStr(theSender, """") > 0 Then 'Check if ""SenderEncoded"" contains """" If InStr(theSender, """") > 0 Then 'Check if ""SenderEncoded"" contains the ""SenderEmail"" surrounded by """" theSender = msg.SenderEmail 'Set the address Else Throw New MAPIException( _ ""Failed to validate email address(SenderEncoded)"") 'Throw exception if for some reason ""SenderEncoded"" does not contain