tumblr tracker

CreateSecureSmtpClient

Library Reference ›› Email ››
Parent Previous Next

Email.CreateSecureSmtpClient


Namespace: Email


Connects to an SMTP server through a secure connection and creates an SMTP client handle that can be used to send emails through that SMTP server.


retval = Email.CreateSecureSmtpClient(MailHost, Port, SecureConnectionType, [UserName], [Password])


Parameters:

- MailHost; a string constant or variable containing SMTP server host name or IP address

- Port; a numeric constant or variable defining the SMTP port to connect to

- SecureConnectionType; constant value, one of SECURE_SSL or SECURE_TLS

- [UserName]; optional; a string constant or variable; if omitted it means that no logging is required

- [Password]; optional; a string constant or variable; password for the [UserName];


Returns:

SMTP client handle; handle value.



Example SSL


$SmtpClient = Email.CreateSecureSmtpClient("smtp.gmail.com", 465, SECURE_SSL, "someuser@gmail.com", "somepassword");



Example TLS


$SmtpClient = Email.CreateSecureSmtpClient("smtp.gmail.com", 587, SECURE_TLS, "someuser@gmail.com", "somepassword");