Overview
Previous  Top  Next


SmtpMail object is used to send messages, obtain status of messages, cancel delivery of messages and set SMTP server parameters. SmtpMail object should remain in memory until all messages are either delivered, canceled or failed. An application can create more than one instance of SmtpMail object if it needs to.

Syntax:

[Visual Basic]


Dim
 objSmtpMail As New AddEmailLib.SmtpMail
objSmtpMail.SmtpServer = "mail.myisp.com"

[VBScript]


Dim
 objSmtpMail
Set
 objSmtpMail = CreateObject("AddEmail.SmtpMail")
objSmtpMail.SmtpServer = "mail.myisp.com"

[C#]


AddEmailLib.SmtpMailClass objSmtpMail = new
 AddEmailLib.SmtpMailClass();
objSmtpMail.SmtpServer = "mail.myisp.com";

[C++]


AddEmailLib::ISmtpMailPtr spSmtpMail;
spSmtpMail.CreateInstance(__uuidof
(AddEmailLib::SmtpMail));
spSmtpMail->PutSmtpServer("mail.myisp.com");


Properties:

SmtpServer
Name or IP address of the SMTP server to use for sending e-mail messages.
SmtpPort
Port number on the SMTP server.
SmtpUsername
User name (account name) on the SMTP server.
SmtpPassword
Password on the SMTP server.
SmtpSSL
Specifies whether SMTP server requires an encrypted connection (TLS/SSL).
SmtpSPA
Specifies whether to use Secure Password Authentication (SPA).
MaxThreads
Maximum number of mail sending threads.
SerialNumber
Serial number to activate purchased copy of AddEmail.
SenderHostname
Fully-qualified hostname of the computer that sends the e-mails.
ConnectAttempts
Number of connect attempts before reporting connection error.
ReplyTimeout
Number of seconds to wait for a response from SMTP server before reporting timeout error.
OnStatusChangeHandler
Handler for the OnStatusChange event.
OnProgressHandler
Handler for the OnProgress event.


Methods:


SimpleSend
Sends simple text or HTML e-mail message synchronously.
SimpleSendAttachment
Sends simple text or HTML e-mail message with attachments synchronously.
SimpleSendHtml
Imports HTML file and sends HTML e-mail with embedded images synchronously.
Send
Sends e-mail message synchronously.
SendAsync
Sends e-mail message asynchronously.
GetStatus
Returns status of e-mail message.
GetErrorCode
Returns error code of failed e-mail message.
GetErrorDescription
Returns error description of failed e-mail message.
Cancel
Cancels sending of queued e-mail message.
CancelAll
Cancels all queued e-mail messages.
GetLastErrorCode
Returns error code of the last synchronous send operation.
GetLastErrorDescription
Returns error description of the last synchronous send operation.
GetQueueSize
Returns number of e-mail messages queued for sending.


Events:

OnStatusChange
Notifies of message status changes.
OnProgress
Notifies of message sending progress.