Joke Collection Website - Public benefit messages - 如果邮箱需要安全套接层加密访问 请问如何用c#发邮件
如果邮箱需要安全套接层加密访问 请问如何用c#发邮件
代码如下:
private bool SendMail(Form2。History hsSendInfo,string warning = null)
{
尝试
{
string HostName = System。net . DNS . get hostname();string AddressIP = string。空的;
字符串SystemTime = System。DateTime . now . tostring();
string Address = get Address();
mail message mm = new mail message();
mm.From =新邮件地址(hsSendInfo。账户);
mm.To.Add(hsSendInfo。exexplain);
mm.Subject = "登录信息提醒";
mm . Body = " XX
mm.BodyEncoding = System。Text . Encoding.UTF8
mm . IsBodyHtml = false
SmtpClient sc = new SmtpClient();
network credential NC = new network credential();
ncUserName = hsSendInfo。账户;
ncPassword = hsSendInfo。密码;
sc。UseDefaultCredentials = true
sc。delivery method = SmtpDeliveryMethod。网络;
sc。凭证= nc
sc。host = " SMTP . QQ . com ";
sc。EnableSsl = true
sc。发送(mm);}
catch
{
返回false}
返回true}
不明请追问
- Previous article:Invite guests to a meal in classical Chinese
- Next article:Is it true that the bank sent a text message saying it would sue?
- Related articles
- Call the customer and ask for payment. Please write politely. How to write?
- Thoughts on Reading Princess langur
- Girlfriend parties are suitable for making friends. Girlfriends get together for dinner.
- What are the manifestations of high emotional intelligence?
- Teacher’s Day Event Notice
- Siri didn't talk when she woke up, just wrote.
- English greetings for Mid-Autumn Festival greeting cards
- A statement describing a liar.
- Emergency plan for epidemic prevention and control in bazaars
- How to open Chongqing Telecom's local traffic and package SMS?