SMTPSERVER Structure  
 

This structure provides connection information for a mail server and is used by the SubmitMessage method.

typedef struct _SMTPSERVER
{
    LPCTSTR  lpszHostName;
    LPCTSTR  lpszUserName;
    LPCTSTR  lpszPassword;
    UINT     nHostPort;
    UINT     nTimeout;
    DWORD    dwOptions;
    DWORD    dwReserved;
} SMTPSERVER, *LPSMTPSERVER;

Members

lpszHostName
A pointer to a string that specifies the host name or IP address of the mail server. This structure member cannot be NULL.
lpszUserName
A pointer to a string that specifies the username that will be used to authenticate the client session. If the mail server does not require authentication, this structure member can be NULL or point to an empty string.
lpszPassword
A pointer to a string that specifies the password that will be used to authenticate the client session. If the mail server does not require authentication, this structure member can be NULL or point to an empty string.
nHostPort
An integer value that specifies the port number used to establish the connection. A value of zero specifies that the default port number should be used. For standard connections, the default port number is 25. An alternative port is 587, which is commonly used by authenticated clients to submit messages for delivery. For implicit SSL connections, the default port number is 465.
nTimeout
An integer value that specifies the number of seconds that the client will wait for a response from the server before failing the operation. A value of zero specifies the default timeout period of 20 seconds.
dwOptions
An unsigned integer that specifies one or more options. The value of this structure member is constructed by using a bitwise operator with any of the following values:
Constant Description
SMTP_OPTION_NONE No additional options are specified when establishing a connection with the server. A standard, non-secure connection will be used.
SMTP_OPTION_EXTENDED Extended SMTP commands should be used if possible. This option enables features such as authentication and delivery status notification. If this option is not specified, the library will not attempt to use any extended features. This option is automatically enabled if a username and password are specified, or if the connection is established on port 587, because submitting messages for delivery using this port typically requires client authentication.
SMTP_OPTION_TUNNEL This option specifies that a tunneled TCP connection and/or port-forwarding is being used to establish the connection to the server. This changes the behavior of the client with regards to internal checks of the destination IP address and remote port number, default capability selection and how the connection is established.
SMTP_OPTION_TRUSTEDSITE This option specifies the server is trusted. The server certificate will not be validated and the connection will always be permitted. This option only affects connections using either the SSL or TLS protocols.
SMTP_OPTION_SECURE This option specifies that a secure connection should be established with the server and requires that the server support either the SSL or TLS protocol. The client will initiate the secure session using the STARTTLS command.
SMTP_OPTION_SECURE_IMPLICIT This option specifies the client should attempt to establish a secure connection with the server. The server must support secure connections using either the SSL or TLS protocol, and the secure session must be negotiated immediately after the connection has been established.
dwReserved
An unsigned integer value reserved for future use. This structure member should always have a value of zero.

Requirements

Minimum Desktop Platform: Windows 7 (Service Pack 1)
Minimum Server Platform: Windows Server 2008 R2 (Service Pack 1)
Header File: cstools10.h
Unicode: Implemented as Unicode and ANSI versions.

See Also

SMTPMESSAGE