Hosting Windows (Plesk) Bantuan

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

Apakah Artikel Ini Berguna?
Terima Kasih Atas Umpan Balik Anda
Senang bisa membantu! Ada hal lain yang dapat kami lakukan untuk Anda?
Maaf tentang hal tersebut. Bagaimana kami bisa membantu lebih?