title: Comparing two VBA codes for getting the SMTP address of a mailitem
body: <p>Is there a difference between the two codes below? Do they achieve the same thing, or bluntly put, which one is the better choice over the other dealing with unforeseen scenarios? objMail is a MailItem object on an Outlook Exchange Server.</p>
  
  <p>Your feedback would appreciated.</p>
  
  <p>[#1]</p>
  
  <pre><code>Dim Sender_email As String
      Sender_email = vbNullString
  
  If objMail.SenderEmailType = "EX" Then
      Sender_email = objMail.Sender.GetExchangeUser.PrimarySmtpAddress
  Else
      Sender_email = objMail.SenderEmailAddress
  End If
  </code></pre>
  
  <p>[#2]</p>
  
  <pre><code>Const PR_SMTP_ADDRESS As String = "http://schemas.microsoft.com/mapi/proptag/0x39FE001E"
  Dim Sender_PA As Outlook.PropertyAccessor
  Set Sender_PA = objMail.Sender.PropertyAccessor 
  Dim Sender_email As String
      Sender_email = vbNullString
  
  If objMail.SenderEmailType = "EX" Then
      Sender_email = Sender_PA.GetProperty(PR_SMTP_ADDRESS)
  Else
      Sender_email = objMail.SenderEmailAddress
  End If
  </code></pre>