Send a mail from .NET

Related documents:

CDOSYS Parameters that work for sending mail

As an Saarthi's customer and a our forum user, janwillemb was kind enough to provide everyone with this piece of code to send mail, using SMTP Authentication (the only way to send emails out from our servers in order to reduce spam). Thank you!

To send an email from .NET, use this code:

Dim msg As New MailMessage("[email protected]", "")
msg.Subject = "Subject here"
msg.Body = "Body here"


Dim client As New SmtpClient("localhost")
client.Credentials = New Net.NetworkCredential("", "")
client.Send(msg)

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

I am receiving System.Security.SecurityException or That assembly does not allow partially trusted callers.

When running your application you may see: That assembly does not allow...

How can I redirect one URL to another on ASP .NET?

Our ASP plans have the following installed:...

Cryptography with ASP .NET

A customer received the following error when attempting to create a RSACryptoServiceProvider from...

I am getting a 404 error on the secondary pages of my MVC application. Why?

To resolve the 404 error issues on secondary pages of a ASP .NET MVC applications, you will need...

My site is showing the following error: HTTP Error 503. The service is unavailable.

The error HTTP Error 503. The service is unavailable. generally means that your application pool...