扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
public void CDOsendmail() { try { CDO.Message Msg = new CDO.Message(); Msg.From = "rattlesnake@263.net"; Msg.To = this.TextBox1.Text.Trim(); Msg.Subject = this.TextBox2.Text.Trim(); Msg.HTMLBody = "<html><body>"+this.TextBox3.Text+"</body></html>"; CDO.IConfiguration Config = Msg.Configuration; ADODB.Fields oFields = Config.Fields; oFields["http://schemas.microsoft.com/cdo/configuration/sendusing"].Value = 2; oFields["http://schemas.microsoft.com/cdo/configuration/sendusername"].Value="rattlesnake"; oFields["http://schemas.microsoft.com/cdo/configuration/sendpassword"].Value="pass"; oFields["http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"].Value=1; oFields["http://schemas.microsoft.com/cdo/configuration/languagecode"].Value=0x0804; oFields["http://schemas.microsoft.com/cdo/configuration/smtpserver"].Value="smtp.263.net"; oFields.Update(); Msg.BodyPart.Charset = "gb2312"; Msg.HTMLBodyPart.Charset = "gb2312"; Msg.Send(); Msg = null; } catch(Exception err) { throw err; } } |
private void Button1_Click(object sender, System.EventArgs e) { this.CDOsendmail(); } |
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。