aspNetEmail

DirectSend.Send Method (EmailMessage)

Sends an EmailMessage without the need of a relay server.

public static bool Send(
   EmailMessage emailMessage
);

Parameters

emailMessage
EmailMessage to send

Return Value

True, if the send was successful

Remarks

Because of the complexites involed with sending mail via SMTP, bounces, Non-Deliverables, network connection outages, etc, only one (1) EmailMessage.To is allowed. The recieving domain will be extracted from the EmailMessage.To property, and the email will be sent to that domain.

Because no relay server is required for this method, aspNetEmail will perform a MX (Mail Exchange) record lookup against the DNS servers configured on your system. Once the MX servers have been located, aspNetEmail will attempt to connect to each MX server until a successful connection is made.

Example

[C#]
             EmailMessage msg = new EmailMessage();
             msg.FromAddress =  "me@mycompany.com";
             msg.To = "you@yourcompany.com";
             msg.Subject = "Your Email Subject Here";
             msg.Body = "Your Email Body Here";
             msg.LogPath = "c:\\email.log";
             msg.Logging = true;
             DirectSend.Send( msg );
             
[Visual Basic]
             Dim msg As New EmailMessage()
             msg.FromAddress = "me@mycompany.com"
             msg.To = "you@yourcompany.com"
             msg.Subject = "Your Email Subject Here"
             msg.Body = "Your Email Body Here"
             msg.LogPath = "c:\email.log"
             msg.Logging = True
             DirectSend.Send(msg)
             

See Also

DirectSend Class | aspNetEmail Namespace | DirectSend.Send Overload List