Send email directly (Simulating SMTP server)

In general, we send email via specified SMTP server. How does the specified SMTP
server know what address this email should be sent to? The answer is... it queries
MX record of recipient's domain via DNS lookup. It then forwards this email to the
SMTP server queried from DNS server. If recipient's server doesn't work fine, sender's
SMTP server will send a failure-delivery report to the sender telling it failed
to send out the email.

How does EASendMail SMTP component work with "Send email Directly"? Firstly, it
queries MX record for recipient address from DNS, then sends email to recipient's
email server directly. In short, if no SMTP server is specified in the code, EASendMail
will send email to recipient directly.

Since querying DNS server consumes CPU time and networking resouce, the performance
of "Send email Directly" is lower than sending email with specified SMTP server.
Moreover, nowaday more and more SMTP servers block email sent from dynamic IP address,
so we don't recommend you to use "Direct Send Email" except you have a static IP
address or you encounter problem with your ISP SMTP server.

Every recipient may have different SMTP server, if there are multiple recipients
in one message and you want to send email directly, you should send the email to
the recipients one by one. To learn more, please refer to the code in Samples.

Remarks

In our solid experience, we don't suggest that you send email directly.

If your IP address is dynamic, most SMTP servers reject your connection due to anti-spam policy. We always suggest that your send email by a SMTP server that has a static internet IP address.
When you relay email by your SMTP server, because you do user authentication at first before you send email to your SMTP server, so your SMTP server doesn’t reject your connection even your IP address is dynamic. Finally your SMTP server sends email to remote SMTP server. Because your SMTP server has a static IP, the email won’t be rejected by remote SMTP server.

If you encountered a temporal SMTP error (4xx), you should retry to send email later. That means you have to write the code to handle retry. So if you have a static IP address, I suggest that you use EASendMail Component + EASendMail Service, EASendMail service can send email directly or send email with specified SMTP server in background and handle delivery retry automatically.

[Visual Basic, C#, C++, JScript.NET] The following example demonstrates how to send
email with EASendMail SMTP Component directly, but it doesn't demonstrates the events
usage. To get the full samples of EASendMail, please refer to Samples section.