asp.net把提交的数据发送到邮箱。请问该如何实现?急
解决方案 »
- asp.net怎么传出JSON 数据
- 如何用asp.net如何实现多列柱状图
- GridView1_RowDataBound触发的问题
- 如何获取上传文件路径中的文件名及后缀
- 100分求提供asp.net(vb.net)源码下载的网址!或者asp.net(vb.net)做新闻系统,留言本等实例的网址!
- 感谢lyq6647(呵呵,真强!),请进来接分
- 谁有ASPnetMenu_setup11.exe的安装序列号,请进!
- 触发器代码问题
- 简单问题,asp.net自带的文件上传使用smtp协议吗?谢
- 如何在Asp.net中调用外部命令行,譬如说osql或者一个vb脚本?
- 请大家帮忙取个小孩名字
- ASPX页面 关闭弹出的子窗体并回发!~
myMail.From = "...";
myMail.To = "...";
myMail.Subject = "回复:"+titleTextBox.ToString();
myMail.Body=reTextBox.ToString(); 可以直接发邮件,不过邮件服务器必须是不用验证的;
{
try
{
CDO.Message oMsg = new CDO.Message();
oMsg.From = f_email;
oMsg.To = t_email;
oMsg.Subject = "东风威客取回密码";
oMsg.HTMLBody = "<html><body>这是您的帐号信息:<br>帐号:"+zh+"<br>密码:"+mm+"<br><a href='http://www.33419.cn'>东风工作室</a></body></html>"; CDO.IConfiguration iConfg = oMsg.Configuration;
ADODB.Fields oFields = iConfg.Fields;
oFields["http://schemas.microsoft.com/cdo/configuration/sendusing"].Value=2;
oFields["http://schemas.microsoft.com/cdo/configuration/sendemailaddress"].Value=f_email; //sender mail
oFields["http://schemas.microsoft.com/cdo/configuration/smtpaccountname"].Value=f_email; //email account
oFields["http://schemas.microsoft.com/cdo/configuration/sendusername"].Value="roamabout";
oFields["http://schemas.microsoft.com/cdo/configuration/sendpassword"].Value="kk123";
oFields["http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"].Value=1;
//value=0 代表Anonymous验证方式(不需要验证)
//value=1 代表Basic验证方式(使用basic (clear-text) authentication.
//The configuration sendusername/sendpassword or postusername/postpassword fields are used to specify credentials.)
//Value=2 代表NTLM验证方式(Secure Password Authentication in Microsoft Outlook Express)
oFields["http://schemas.microsoft.com/cdo/configuration/languagecode"].Value=0x0804;
oFields["http://schemas.microsoft.com/cdo/configuration/smtpserver"].Value="smtp.126.com"; oFields.Update();
oMsg.BodyPart.Charset="gb2312";
oMsg.HTMLBodyPart.Charset="gb2312"; oMsg.Send();
oMsg = null;
}
catch (Exception e)
{
throw e;
}
}再添加一个引用,如果你是xp系统请到c:\windiws下找到cdosys.dll,如果是2000到c:\winnet找cdosys.dll(不要说不会添加引用吧???)