Jmail.MailServerUserName=UserName;
Jmail.MailServerPassWord=PassWord;
Jmail.Body=body+"\n"+TimeSend.ToString();
Jmail.Send(EmailHost,false);
Jmail.Close() ;
这里不知道怎么获得EmailHost的地址。请高手指点。
还有UserName是指我自己的邮箱地址吗?如:[email protected]

解决方案 »

  1.   

    /// <summary>
    /// 发送密码重置邮件
    /// </summary>
    public void sendMail(string memberInnerCode,string userMail)
    {
    try
    {
    //生成密码重置安全码
    MailMessage email = new System.Web.Mail.MailMessage(); 
    email.To = userMail.ToString(); 
    email.From = "发信人邮件地址"; 
    email.Body = "尊敬的用户:   {邮件内容}";
    email.Subject = "{邮件主题}"; 
    email.BodyFormat = MailFormat.Text;  // 如果发送服务器需要密码就写下面这三行 
    email.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1"); 
    email.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "用户名"); 
    email.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "邮箱密码"); 
    // 发送服务器验证部分结束  SmtpMail.SmtpServer = "smtp.126.com"; 
    SmtpMail.Send(email); 
    }
    catch(Exception err)
    {
    Response.Write(err.Message.ToString());
    } }
      

  2.   

    要先引用using System.Web.Mail;
      

  3.   

    添加jmail引用 public static int SendMail(string toMail, string subject,string body) 

    string serverName = "";
    string email = "";
    string userName = "";
    string password = "";

    GetMailConfig(out serverName, out email, out userName, out password); // 发送邮件需要的参数,你可以自己设置 jmail.Message Jmail = new jmail.Message();
    Jmail.Silent = true;
    Jmail.Logging = true;
    Jmail.Charset = "GB2312";
    Jmail.ContentType = "text/html";
    Jmail.AddRecipient(toMail, "", "");
    Jmail.ReplyTo = ""; // 答复邮件地址
    Jmail.From = email;
    Jmail.MailServerUserName = userName;
    Jmail.MailServerPassWord = password;
    Jmail.Subject = subject;
    Jmail.Body = body;
    Jmail.Send(serverName, false);
    Jmail.Close(); return Jmail.ErrorCode; // 返回 0 表示成功
    }
      

  4.   

    请问
    // 如果发送服务器需要密码就写下面这三行 
    email.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1"); 
    email.Fields.Add
    ("http://schemas.microsoft.com/cdo/configuration/sendusername", "用户名"); 
    email.Fields.Add
    ("http://schemas.microsoft.com/cdo/configuration/sendpassword", "邮箱密码"); 
    是指什么可以以163为列吗?
      

  5.   

    http://www.aspxboy.com/417/default.aspx
      

  6.   

    SmtpMail.SmtpServer = "smtp.126.com"; 
    SmtpMail.Send(email); //有问题.The message could not be sent to the SMTP server. The transport error code was 0x80040217. The server response was not available 
      

  7.   

    请问哪里有最新的Jmail.dll下载啊!
      

  8.   

    用.net自带的就可以了.
     afraidren(美尼斯)
    已经给了解决方法
      

  9.   

    自带的用过了,存在一些问题。这我以前已经发了个贴。所以现在改用Jmail来发。
      

  10.   

    #region JMail使用参数说明
    /*
     (1)Body(信件正文) : 字符串 
    如:JMail.Body = "这里可以是用户填写的表单内容,可以取自From。" 
    (2)Charset(字符集,缺省为"US-ASCII") : 字符串 
    如:JMail.Charset = "US-ASCII" 
    (3)ContentTransferEncoding : 字符串 
    指定内容传送时的编码方式,缺省是"Quoted-Printable" 
    如:JMail.ContentTransferEncoding = "base64" 
    (4)ContentType(信件的contentype. 缺省是"text/plain") : 字符串
    如果你以HTML格式发送邮件, 改为"text/html"即可。 
    如:JMail.ContentType = "text/html" 
    (5)Encoding : 字符串 
    设置附件编码方式(缺省是"base64)。 可以选择使用的是"base64", "uuencode" or "quoted-printable" 
    如:JMail.Encoding = "base64" 
    (6)Log(Jmail创建的日志,前提loging属性设置为true,见下面) : 字符串 
    如:使用Response.Write( JMail.Log )语句列出日志信息。 
    (7)Logging(是否使用日志) : 布尔型 
    如:JMail.Logging = true 
    (8)Recipients : 字符串 
    只读属性,返回所有收件人 
    如:Response.Write( "" + JMail.Recipients + "" ); 
    (9)ReplyTo(指定别的回信地址) : 字符串 
    如:JMail.ReplyTo = "[email protected]
    (10)Sender( 发件人的邮件地址) : 字符串 
    如:JMail.Sender = "[email protected]
    (11)SenderName(发件人的姓名) : 字符串 
    如:JMail.SenderName = "一克" 
    (12)ServerAddress(邮件服务器的地址) : 字符串 
    你可以指定多个服务器,用分号点开。可以指定端口号。 
    如果serverAddress保持空白,JMail会尝试远程邮件服务器,然后直接发送到服务器上去。 
    如:JMail.ServerAddress = "mail.263.net.cn" 
    (13)Subject(设定邮件的标题,可以取自From。):字符串 
    如:JMail.Subject = "客户反馈表单" 
    (14)添加文件附件到邮件 
    如:JMail.AddAttachment( "c:\anyfile.zip" ) 
    (15)AddCustomAttachment( FileName, Data ) 
    添加自定义附件. 
    如:JMail.AddCustomAttachment( "anyfile.txt", "Contents of file" ); 
    (16)AddHeader( Header, Value ) 
    添加用户定义的信件标头。 
    如:JMail.AddHeader( "Originating-IP","192.168.10.10" ); 
    (17)AddRecipient(收件人):字符串 
    如:JMail.AddRecipient( "[email protected]" ); 
    (18)AddRecipientBCC( Email ),密件收件人: 
    如:JMail.AddRecipientBCC( "[email protected]" ); 
    (19)AddRecipientCC( Email ) ,抄送收件人: 
    如:JMail.AddRecipientCC( "[email protected]" ) 
    (20)AddURLAttachment( URL, 文档名) 
    下载并添加一个来自url的附件. 第二个参数"文档名", 用来指定信件收到后的文件名。 
    如:JMail.AddURLAttachment( "http://www.chinabs.net/jmail.zip", "jmail" ) 
    (21)AppendBodyFromFile( 文件名) ,将文件作为信件正文: 
    如:JMail.AppendBodyFromFile( "c:\anyfile.txt" ) 
    (22)AppendText( Text ) 
    追加信件的正文内容,比如增加问候语或者其它信息。 
    如:JMail.AppendText( "欢迎访问本站!" ) 
    (23)Close() ,强制JMail关闭缓冲的与邮件服务器的连接: 
    如:JMail.Close() 
    (24)Execute() ,执行邮件的发送 
    如:JMail.Execute()   */
    #endregion
    ================================/// <summary>
    /// 发送邮件:使用smtp.163.com邮件服务器发送到[email protected]
    /// </summary>
    public static void SendMail_Test()
    {
    MailInfo obj=new MailInfo();
    obj.ToEmail="[email protected]";
    obj.SendMailUserName="userName";
    obj.SendMailServer="smtp.163.com";
    obj.SendMailPwd="password";
    obj.MailTitle="测试邮件标题";
    obj.MailContent="测试邮件内容内容";
    obj.FromName="";
    obj.FromEmail="[email protected]";

    SendMail(obj);
    }
      

  11.   

    请问哪里有最新的Jmail.dll下载啊!我下载的Jmail.dll好象缺少几个方法啊。