Sometimes sending mails using an SMTP server is not feasible for a project’s requirement. We may want to utilize the MX record of the recipient’s domain name. The following technical tip shows how to send mails using mail servers of recipient’s domain. We will be using Aspose.Network for doing this.

[C#]

MailMessage msg = new MailMessage();
msg.From = "sender@mail.com";
msg.To = "use1@mail.com;user2@mail.com";
msg.Subject = "dns sending";
msg.Body = "it is a test.";
DnsMailClient client = new DnsMailClient();
client.Send(msg);

[VB]

Dim msg As MailMessage = New MailMessage()
msg.From = "sender@mail.com"
msg.To = "use1@mail.com;user2@mail.com"
msg.Subject = "dns sending"
msg.Body = "it is a test.
Dim client As DnsMailClient = New DnsMailClient()
client.Send(msg)

More about Aspose.Network

- Homepage of Aspose.Network:
- Read more technical tips by Aspose.Network.

Contact Information
Suite 119, 272 Victoria Avenue
Chatswood, NSW, 2067
Australia
Aspose - The .NET and Java component publisher
sales@aspose.com
Phone: 888.277.6734
Fax: 866.810.94651