Skip to main content
Call us
Phone numbers and hours
Help Center

Explore our online help resources

Help

Windows Hosting (Plesk) Help

Send email using System.Net.Mail in Windows Hosting

To send mail using System.Net.Mail, you need to configure your SMTP service in your application's web.config file using these values for mailSettings:

<system.net>
  <mailSettings>
    <smtp from="your email address">
      <network host="relay-hosting.secureserver.net" port="25" />
    </smtp>
  </mailSettings>
</system.net>

The network rule's value will be used when you instantiate an SmtpClient in your code.

C# code example

You can then use code similar to this to send email from your application:

MailMessage message = new MailMessage();
message.From = new MailAddress("your email address");

message.To.Add(new MailAddress("your recipient"));

message.Subject = "your subject";
message.Body = "content of your email";

SmtpClient client = new SmtpClient();
client.Send(message);

Community Related

mhelp123's Avatar
Cannot receive email after renew

6 Replies

Last posted about 2 years ago.

cspurlock's Avatar
cannot send from outlook 2010 with windows 7 pro

2 Replies

Last posted 9 months ago.

devika156's Avatar
MS SQL Server / Dot Net form issue

1 Replies

Last posted over 4 years ago.

Flight23's Avatar
Sening an email alert to all of our customers

1 Replies

Last posted over 4 years ago.

Don't see what you are looking for? Search the Community