tfSmtpUserSetSsl

Jump to: navigation, search

Table of Contents >> Optional Protocols >> SMTP


#include <trsocket.h>


int tfSmtpUserSetSsl (
ttSmtpClientHandle smtpClientHandle,
int sessionId,
char TM_FAR * serverCommonName
);


Function Description

After creating a new SSL session ID with tfSslNewSession(), and adding the required certificates to the SSL session, call this function to attach that SSL session ID to the SMTP client you created by calling tfSmtpUserNewSession(). Provide the SMTP serverCommonName (e.g. smtp.treck.com) so Treck can verify the certificate sent by the SMTP server.



Parameters

  • smtpClientHandle
    The SMTP client session handle as returned by tfSmtpUserNewSession().
  • sessionId
    The SSL session ID returned by tfSslNewSession().
  • serverCommonName
    The name of the server, as it appears in the server's certificate.


Returns

  • TM_ENOERROR
    Success.
  • TM_EINVAL
    Invalid SMTP client session handle or SSL session ID.
  • TM_EPERM
    Operation not permitted after connecting.
  • TM_ENOMEM
    Cannot allocate memory to copy server name.


Table of Contents >> Optional Protocols >> SMTP