开发者

how to use mailing system in C# [closed]

开发者 https://www.devze.com 2022-12-11 09:55 出处:网络
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and开发者_Go百科 the expected results. See also: Stack Overflow question checklist

Closed 8 years ago.

Improve this question

i want to have an email system , when user done an action after that someone recieve an email in C# so now how I can do that ??


You could use the .Net SmtpClient class as follows:

using System.Net.Mail;


// the e-mail details
String from = "me@server.com";
String to   = "someone@server.com";;

// build up the message
MailMessage message = new MailMessage(from, to);
message.Subject = "My Title";
message.Body += "This is the biody of my message";

// create a server pointing to your mail server
String server = "mail.server.com";

// create a client
SmtpClient client = new SmtpClient(server);
client.Credentials = CredentialCache.DefaultNetworkCredentials;

// send the message
client.Send(message);


To send an email in .NET you could use the SmptClient class.

0

精彩评论

暂无评论...
验证码 换一张
取 消