I have tried using mailItem.SenderEmailAddress and mailItem.Sender.Address but they both return a string that looks like this:
/O=DO
If someone's still looking for a solution to this problem, here is a simplified and true-blue VBA version of the code to handle this requirement.
Public Sub GetCurrentItem()
On Error Resume Next
Set ObjSelectedItem = Outlook.ActiveExplorer.Selection.Item(1)
If TypeName(ObjSelectedItem) = "MailItem" Then
If ObjSelectedItem.SenderEmailType = "EX" Then
MsgBox (ObjSelectedItem.Sender.GetExchangeUser.PrimarySmtpAddress)
Else
MsgBox (ObjSelectedItem.SenderEmailAddress)
End If
Else
MsgBox ("No items selected (OR) Selected item not a MailItem.")
End If
Set ObjSelectedItem = Nothing
End Sub