try {mailmessage mm = new MailMessage (); MailAddress Fromma = new MailAddress ("xxxx@qq.com"); MailAddress Toma = new MailAddress ("MMMMMMM@qq.com", null); Mm. from = Fromma; Recipient mm. To.add ("MMMMMM@qq.com"); Mailbox title mm. Subject = "Hello Dear:"; Mm. Isbodyhtml = true; Message content mm. Body = "Hello Mr Meteor!" "; Encoding format for content mm. bodyencoding = System.Text.Encoding.UTF8; Mm. ReplyTo = Toma; Mm. Sender =fromma; Mm. Isbodyhtml = false; Mm. Deliverynotificationoptions = deliverynotificationoptions.onsuccess; Mm. Cc. ADD (Toma); SmtpClient sc = new SmtpClient (); NetworkCredential NC = new NetworkCredential (); nc. UserName = "XXXXX@qq.com";//your e-mail address NC. Password = "zzzzz";//Your email password, here's the secretCode is xxxxx@qq.com mailbox password, special instructions under ~ SC. useDefaultCredentials = true; Sc. Deliverymethod = Smtpdeliverymethod.network; Sc. Credentials = NC; If this is reported to mail from the address must be same as authorization user this error, is your QQ mailbox does not open SMTP,//to your own mailbox settings can be! Under the account, if is 163 mailbox, below should become smtp.163.com SC. Host = "smtp.qq.com"; Sc. Send (mm); } catch (Exception ex) {throw new Exception (ex). Message); }
This is I use my 2 QQ test success, there are problems I hope you correct ~ ~
More C # calls QQ mailbox SMTP send mail modified version code related articles please follow topic.alibabacloud.com!
"Recommended"
1. Detailed description Python uses SMTP to send mail instances
2. Python code summary for sending mail using SMTP
3. Share Python to implement SMTP send message graphics instances
4. Python sends mail using SMTP
5. PHP smtp Send mail
6. Python SMTP Mail module detailed
7. Python smtplib module sends SSL/TLS secure message instances