ASP中CDO.Message 怎么用
发布网友
发布时间:2023-05-15 09:26
我来回答
共2个回答
热心网友
时间:2024-12-12 10:51
try
{
CDO.Message oMsg = new CDO.Message();
oMsg.From = "";//发送方邮箱
oMsg.To = "";//接收方邮箱
oMsg.Subject = "";//主题
oMsg.HTMLBody = "";//内容
CDO.IConfiguration iConfg = oMsg.Configuration;
ADODB.Fields oFields = iConfg.Fields;
oFields["http://schemas.microsoft.com/cdo/configuration/sensing"].Value=2;
oFields["http://schemas.microsoft.com/cdo/configuration/sensername"].Value="";//用户名
oFields["http://schemas.microsoft.com/cdo/configuration/sendpassword"].Value="";//密码
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="";//邮件服务器
oFields.Update();
oMsg.BodyPart.Charset="gb2312";
oMsg.HTMLBodyPart.Charset="gb2312";
oMsg.Send();
oMsg = null;
}
catch (Exception ex)
{
throw ex;
}
热心网友
时间:2024-12-12 10:51
http://blog.sina.com.cn/s/blog_4c5e840d010009vw.html
可以看看这里