跳转到主要内容
联系我们
  • 新加坡 服务时间:9:00~18:00 周一至周五+65 6701 1359
联系电话和工作时间
预约回电

无须在线等候,提交预约我们将尽快回电。

预约回电
帮助中心

使用我们的在线帮助资源

帮助

Windows Hosting (Plesk) 帮助

Send email using System.Net.Mail

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);

社区相关

TimothyBrannan's Avatar
Cant receive emails

2 回复

Last posted almost 2 years ago.

Jaclyn's Avatar
Autoresponder not working

6 回复

Last posted almost 2 years ago.

smylz's Avatar
cant send email using php mailer

2 回复

Last posted almost 3 years ago.

wineisgud4u's Avatar
Email: Unable to Send Replies

9 回复

Last posted almost 3 years ago.

看不到您在寻找的东西?搜索社区