SMTP Wrapper around System.Net.Email.SmtpClient. Provided here mainly to provide compatibility with existing wwSmtp code and to provide a slightly more user friendly front end interface on a single object.
Westwind.Utilities.InternetTools.SmtpClientNative
public class SmtpClientNative : object, IDisposable
Class Members
Member | Description | |
---|---|---|
Constructor |
||
SendComplete |
Event fired when sending of a message or multiple messages is complete and the connection is to be closed. This event occurs only once per connection as opposed to the MessageSendComplete event which fires after each message is sent regardless of the number of SendMessage operations. | |
SendError |
Event fired when an error occurs during processing and before the connection is closed down. | |
AlternateText |
||
AlternateTextContentType |
The content type for the alternate | |
AttachmentList |
List of attachment objects | |
Attachments |
Any attachments you'd like to send | |
BCC |
Blind Copy Recipients | |
CC |
Carbon Copy Recipients | |
CharacterEncoding |
Character Encoding for the message. | |
ContentType |
The content type of the message. text/plain default or you can set to any other type like text/html | |
Encoding |
The character Encoding used to write the stream out to disk Defaults to the default Locale used on the server. | |
Error |
Error Flag set when an error occurs. | |
ErrorMessage |
An Error Message if the result is negative or Error is set to true; | |
HandleExceptions |
Determines whether wwSMTP passes back errors as exceptions or whether it sets error properties. Right now only error properties work reliably. | |
Headers |
SMTP headers for this email request | |
LogFile |
An optional file name that appends logging information for the TCP/IP messaging to the specified file. | |
MailServer |
Mail Server to send message through. Should be a domain name (mail.yourserver.net) or IP Address (211.123.123.123). | |
Message |
The body of the message. | |
Password |
Password to connect to the mail server. | |
Priority |
Determines the priority of the message | |
Recipient |
Email address or addresses of the Recipient. Comma delimit multiple addresses. To have formatted names use "Rick Strahl" rstrahl@west-wind.com | |
ReplyTo |
The ReplyTo address | |
ReturnReceipt |
Determines whether a return receipt is sent | |
SenderEmail |
Email address of the sender | |
SenderName |
Display name of the sender (optional) | |
ServerPort |
Port on the mail server to send through. Defaults to port 25. | |
Subject |
Message Subject. | |
Timeout |
Connection timeouts for the mail server in seconds. If this timeout is exceeded waiting for a connection or for receiving or sending data the request is aborted and fails. | |
UserAgent |
The user agent for the x-mailer | |
Username |
Username to connect to the mail server. | |
UseSsl |
Use Tls Security | |
AddAlternateView |
Adds a new Alternate view to the request. Passed from FoxPro which sets up this object. public void AddAlternateView(AlternateView view) |
|
AddHeader |
Adds an Smtp header to this email request. Headers are always cleared after a message has been sent or failed. public void AddHeader(string headerName, string value) |
|
AddHeadersFromString |
Adds headers from a CR/LF separate string that has key:value header pairs defined. public void AddHeadersFromString(string headers) |
|
Close |
Cleans up and closes the connection public bool Close() |
|
Connect |
Starts a new SMTP session. Note this doesn't actually open a connection but just configures and sets up the SMTP session. The actual connection is opened only when a message is actually sent public bool Connect() |
|
Dispose |
public sealed void Dispose() |
|
LoadSmtpClient |
Lets you load the actual SMTP client instance prior to use so you can manipulate the actual Smtp instance. public SmtpClient LoadSmtpClient() |
|
SendMail |
Fully self contained mail sending method. Sends an email message by connecting and disconnecting from the email server. public bool SendMail() |
|
SendMailAsync |
Run mail sending operation on a separate thread and asynchronously Operation does not return any information about completion. public void SendMailAsync() |
|
SendMessage |
Sends an individual message. Allows sending several messages on the same SMTP session without having to reconnect each time. public bool SendMessage(string recipient, string ccList, string bccList) |
Requirements
Namespace: Westwind.Utilities.InternetToolsAssembly: westwind.utilities.dll
© West Wind Technologies, 1996-2016 • Updated: 12/12/15
Comment or report problem with topic