jmail发送邮件报错,请各位帮个忙看下什么错
Message jmail = new Message(); jmail.Charset = "GB2312";//邮件字符集
jmail.Encoding = "BASE64";//附件编码格式
jmail.ContentType = "text/html";//内容格式
jmail.ISOEncodeHeaders = false;//是否将信头编码成iso-8859-1字符集
jmail.Priority = Convert.ToByte(1);//优先级,邮件的紧急程序,1 为最快,5 为最慢, 3 为默认值 jmail.From = "[email protected]";//发送人的邮件地址
jmail.FromName = "[email protected]";//发送人的姓名
jmail.Subject = "subject";//邮件主题
jmail.MailServerUserName = "[email protected]";//身份验证的用户名
jmail.MailServerPassWord = "******";//用户密码 jmail.AddRecipient("[email protected]", "", null);//添加收件人的信箱 jmail.Body = "body"; jmail.Send("stmp.163.com", false);//参数为邮件服务器
jmail4.5我装了的操作系统:windows 7报错:The message was undeliverable. All servers failed to receive the message
//堆栈跟踪:[COMException (0x8000ffff): The message was undeliverable. All servers failed to receive the message]
jmail.MessageClass.Send(String mailServer, Boolean enque) +0
Web.z_email.Button1_Click(Object sender, EventArgs e) in E:\Web\z_email.aspx.cs:40
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
Message jmail = new Message(); jmail.Charset = "GB2312";//邮件字符集
jmail.Encoding = "BASE64";//附件编码格式
jmail.ContentType = "text/html";//内容格式
jmail.ISOEncodeHeaders = false;//是否将信头编码成iso-8859-1字符集
jmail.Priority = Convert.ToByte(1);//优先级,邮件的紧急程序,1 为最快,5 为最慢, 3 为默认值 jmail.From = "[email protected]";//发送人的邮件地址
jmail.FromName = "[email protected]";//发送人的姓名
jmail.Subject = "subject";//邮件主题
jmail.MailServerUserName = "[email protected]";//身份验证的用户名
jmail.MailServerPassWord = "******";//用户密码 jmail.AddRecipient("[email protected]", "", null);//添加收件人的信箱 jmail.Body = "body"; jmail.Send("stmp.163.com", false);//参数为邮件服务器
jmail4.5我装了的操作系统:windows 7报错:The message was undeliverable. All servers failed to receive the message
//堆栈跟踪:[COMException (0x8000ffff): The message was undeliverable. All servers failed to receive the message]
jmail.MessageClass.Send(String mailServer, Boolean enque) +0
Web.z_email.Button1_Click(Object sender, EventArgs e) in E:\Web\z_email.aspx.cs:40
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
解决方案 »
- 页面回发后不想从数据库重新获取数据集,只页面第一次加载的时候获取,想在这个页面未关闭之前,一直保存这个数据集,因为数据集的数据是不会变得。
- Jquery 缺少对象
- 一个关于session的问题
- window.showModalDialog("a.aspx")后出现的问题,那个高人能解决?解决问题后马上给分。
- 高难度(怎么样提取PDF文件中的图片和样式)
- 点击两次TREE节点才能响应连接
- 菜鸟求教有关界面显示的问题
- 求教 datagrid中某一列数据过长,怎么使他自动换行???
- dataReader.Read() 如果没有查到相关纪录,该如何处理???
- 如何生成XML文档,在线讨论
- 新年好,请教个提交页面问题。
- 没有找到表0,我的DataSet.时得时不得的问题求助,大家帮看看
http://blog.csdn.net/sytweibo/article/details/4208256
我关掉了防火墙,杀毒软件,排除掉2我是在vs里直接运行的,这里边jmail权限又怎么改呢
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Web.Mail;
using System.Web.Util;
using myJmail;using Tool;
using Manager;
using Entity;public partial class UserControls_Jmaill : System.Web.UI.UserControl
{
string strCurrentPath = DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString();
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnSend_Click(object sender, EventArgs e)
{
try
{
this.lblTitle.Text = "发送邮件控件";
myJmail.Message Jmail = new myJmail.Message();
DateTime t = DateTime.Now;
String Subject = this.txtTitle.Text;
String body = this.txtContent.Text;
string FromEmail = this.txtFormEmail.Text.Trim();//你的email
String ToEmail = this.txtToEmail.Text;//对方的email
String AddAttachment = this.FileUploadSubject.PostedFile.FileName;
//Silent属性:如果设置为true,JMail不会抛出例外错误. JMail. Send( () 会根据操作结果返回true或false
Jmail.Silent = true;
//Jmail创建的日志,前提loging属性设置为true
Jmail.Logging = true;
//字符集,缺省为"US-ASCII"
Jmail.Charset = "GB2312";
//信件的contentype. 缺省是"text/plain") : 字符串如果你以HTML格式发送邮件, 改为"text/html"即可。
// Jmail.ContentType = "text/html";
ToEmail = ToEmail.Replace("\n", "").Replace(" ", "");
string[] str = ToEmail.Split(’,’); for (int i = 0; i < str.Length; i++)
{
//添加收件人
Jmail.AddRecipient(str[i], "", "");
Jmail.From = FromEmail;
//发件人邮件用户名
Jmail.MailServerUserName = FromEmail;
//发件人邮件密码
Jmail.MailServerPassWord = "";//FromEmail邮箱的登陆密码
//设置邮件标题
Jmail.Subject = Subject;
// 邮件添加附件,(多附件的话,可以再加一条Jmail.AddAttachment( "c:\\test.jpg",true,null);)就可以搞 定了。[注]:加了附件,讲把上面的Jmail.ContentType="text/html";删掉。否则会在邮件里出现乱码。
Jmail.AddAttachment(AddAttachment, true, null);
//邮件内容
Jmail.Body = body + t.ToString();
//加密文件
//Jmail.PGPEncrypt = true;
//Jmail发送的方法
Jmail.Send("smtp.163.com", false);
Jmail.ClearAttachments();
Jmail.ClearRecipients();
}
Jmail.Close();
}
catch (Exception ex)
{
this.lblMessage.Text = ex.Message;
}
}
}
自带不就可以了么
using System.Net.Mail;
http://msdn.microsoft.com/zh-cn/library/system.net.mail