try
{
MailMessage Message = new MailMessage();
Message.To =E_mail1.Value; //发送到
Message.From = "[email protected]"; //本地邮箱
Message.Subject = "你的朋友"+user.Value+"给您的推荐站点"; //邮件主题
Message.Body =" 。。";
Message.Body+=content.Value; //邮件内容;
Message.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1");
Message.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "jj");
Message.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "*****");
SmtpMail.SmtpServer = "smtp.163.com";
SmtpMail.Send(Message);
Response.Write("<script>alert('发送成功!')</"+"script>");
}
catch (Exception ee)
{
Response.Write("<script>alert('发送失败!')</"+"script>"); }
}用上面代码可以发送成功,但想改为sina 的企业邮箱却不可以了。怎么办。sina 的 Stmp 是:
SmtpMail.SmtpServer = "smtp.sina.net";
急啊,今天要完成的啊。
{
MailMessage Message = new MailMessage();
Message.To =E_mail1.Value; //发送到
Message.From = "[email protected]"; //本地邮箱
Message.Subject = "你的朋友"+user.Value+"给您的推荐站点"; //邮件主题
Message.Body =" 。。";
Message.Body+=content.Value; //邮件内容;
Message.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1");
Message.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "jj");
Message.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "*****");
SmtpMail.SmtpServer = "smtp.163.com";
SmtpMail.Send(Message);
Response.Write("<script>alert('发送成功!')</"+"script>");
}
catch (Exception ee)
{
Response.Write("<script>alert('发送失败!')</"+"script>"); }
}用上面代码可以发送成功,但想改为sina 的企业邮箱却不可以了。怎么办。sina 的 Stmp 是:
SmtpMail.SmtpServer = "smtp.sina.net";
急啊,今天要完成的啊。
解决方案 »
- 求救......这个问题有点奇怪!
- 请各位老大支招
- 也不知道这算不算vs 2005的一个Bug?
- 请问关于视图状态的问题。
- Single Sign-on ,谁有好的成功例子呀,搞一天没有结果,这有个开源的
- 我的框架左边页是一个TREEVIEW控件,点一个节点,右边页出现相应的网页,怎么实现呀,哪位大哥指点一下
- 在IIS中运行程序后出现如下情况是什么意思??该怎样处理???
- C#里模糊查询:Result="select * from word where title like "+'%"&title&"%';
- fckeditor无法正常显示
- 关于文件保存的问题
- 为什么放上table服务器控件后,看不到边框了!
- 服务器怎么连ORACLE9I,我使用连8I的方法,提示未找到客户端和网络组件,但我按了客户端,不好使
我不上新浪,所以帮不了你。
Message.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "web");
Message.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "×××××");
SmtpMail.SmtpServer = "smtp.sina.com.cn";//smtp.sina.net ,smtp.sina.com 都不行啊,怎么办啊。
catch (Exception ee)
{
Response.Write("<script>alert('发送失败!"+ee.ToString()+"')</script>");看看是什么错误就可以了