Partager via


SenderEmailType Property

Returns a String that represents the type of entry for the e-mail address of the sender of the message, meeting item, or post, such as 'SMTP' for Internet address, 'EX' for a Microsoft Exchange server address, etc. Read-only.

expression.SenderEmailType

*expression   * Required. An expression that returns one of the objects in the Applies To list.

Example

The following Microsoft Visual Basic for Applications (VBA) example demonstrates how to use the SenderEmailType property. To run this example without errors, an e-mail item should be open in the active inspector window.

Sub SenderEmailTypeExample()
    Dim myOlApp As New Outlook.Application
    Dim mail As Outlook.MailItem
    Set mail = myOlApp.ActiveInspector.CurrentItem
    MsgBox mail.SenderEmailType
    If mail.SenderEmailType = "SMTP" Then
        MsgBox "Message from Internet e-mail user."
    Else
    If mail.SenderEmailType = "EX" Then
        MsgBox "Message from internal Exchange user."
    End If
    End If
End Sub

Applies to | MailItem Object | MeetingItem Object | PostItem Object