aspNetEmail

DirectSend.Send Method (String, String, String, String, MailFormat)

Sends an email, without the need for a relay server.

public static bool Send(
   string fromAddress,
   string toAddress,
   string subject,
   string body,
   MailFormat bodyFormat
);

Parameters

fromAddress
The FROM address of the email
toAddress
The To Address of the email
subject
The Subject of the email
body
The Body of the email
bodyFormat
The BodyFormat of the email.

Return Value

true if the email was successful

Remarks

Because of the complexities involed with sending mail via SMTP, bounces, Non-Deliverables, network connection outages, etc, only one (1) 'toAddress' is allowed. The recieving domain will be extracted from the 'toAddress' 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#]
             DirectSend.Send( "me@mycompany.com", "you@yourcompany.com", "Your Email Subject Here", "Your Email Body Here", MailFormat.Text );
             
[Visual Basic]
             DirectSend.Send( "me@mycompany.com", "you@yourcompany.com", "Your Email Subject Here", "Your Email Body Here", MailFormat.Text )
             

See Also

DirectSend Class | aspNetEmail Namespace | DirectSend.Send Overload List