Initializes security library for SMTP SSL/TLS connection.
[Syntax] Visual C++: HRESULT SSL_init( long* pVal ) Visual Basic: SSL_init( ) As Long
Return Values
This method returns zero if succeeded, otherwise return valus is non-zero.
Remarks
Mail object uses SSL/TLS connection to send email after this method is invoked. To cancel SSL/TLS mode, you can invoke SSL_uninit method.
This method requires IE 5.0 or later in Windows95 or SP4 or later in Windows NT4.0.
Example Code
[Visual Basic] 'Connect server under SSL/TLS by STARTTLS command Dim oSmtp As EASendMailObjLib.Mail Set oSmtp = new EASendMailObjLib.Mail 'Before using Mail, LicenseCode must be assigned. oSmtp.LicenseCode = "TryIt" oSmtp.SSL_init oSmtp.SSL_starttls = 1 oSmtp.Subject = "test for ssl" oSmtp.BodyText = "test body" oSmtp.FromAddr = "test@adminsystem.net" oSmtp.AddRecipient "Support Team", "Support@AdminSystem.NET", 0 If oSmtp.SendMail() = 0 Then MsgBox "Message delivered" Else MsgBox oSmtp.GetLastErrDescription() End If oSmtp.SSL_uninit 'Connect server under SSL/TLS by direct SSL/TLS Dim oSmtp As EASendMailObjLib.Mail Set oSmtp = new EASendMailObjLib.Mail 'Before using Mail, LicenseCode must be assigned. oSmtp.LicenseCode = "TryIt" If oSmtp.SSL_init() <> 0 Then MsgBox "initialize ansslplus failed" End If oSmtp.SSL_starttls = 0 'SMTP server usually uses 465 as the alone SSL/TLS port oSmtp.ServerPort = 465 oSmtp.Subject = "test for ssl" oSmtp.BodyText = "test body" oSmtp.FromAddr = "test@adminsystem.net" oSmtp.AddRecipient "Support Team", "Support@AdminSystem.NET", 0 If oSmtp.SendMail() = 0 Then MsgBox "Message delivered" Else MsgBox oSmtp.GetLastErrDescription() End If oSmtp.SSL_uninit
See Also