Email source code
2016-08-23
0 0 0
no vote
Other
Earn points
try
{
Coding provisional compulsory as GB2312
Encoding encoding = Encoding.GetEncoding(936);
MailMessage Message = new MailMessage(
New MailAddress ("your mailbox", "5", encoding),//first is the sender's address, and the second parameter is the sender
New MailAddress (TextBox1.Text));//the recipient's mailbox
Message.SubjectEncoding = encoding;
Message.Subject =TextBox2.Text;//title
Message.BodyEncoding = encoding;
Message.Body = TextBox3.Text; The main body
SmtpClient smtpClient = new SmtpClient ("SMTP.163.com");//mail server
SmtpClient.Credentials = new NetworkCredential ("your mailbox username", "your mailbox passwords");//email username and password
smtpClient.Timeout = 999999;
smtpClient.Send(Message);
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
{
Coding provisional compulsory as GB2312
Encoding encoding = Encoding.GetEncoding(936);
MailMessage Message = new MailMessage(
New MailAddress ("your mailbox", "5", encoding),//first is the sender's address, and the second parameter is the sender
New MailAddress (TextBox1.Text));//the recipient's mailbox
Message.SubjectEncoding = encoding;
Message.Subject =TextBox2.Text;//title
Message.BodyEncoding = encoding;
Message.Body = TextBox3.Text; The main body
SmtpClient smtpClient = new SmtpClient ("SMTP.163.com");//mail server
SmtpClient.Credentials = new NetworkCredential ("your mailbox username", "your mailbox passwords");//email username and password
smtpClient.Timeout = 999999;
smtpClient.Send(Message);
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
c#
源码
发送
邮件
Related Source Codes
No. 186: DX0110- Source code for community propert
0
0
no vote
No. 219: DX0149- Source code for community propert
0
0
no vote
Verification code identification
0
0
no vote
CSV data analysis tool
0
0
no vote
Source code of hospital medical record information
0
0
no vote
No comment