如题

解决方案 »

  1.   

    不太清楚你的目的。发邮件请查看下:jmail或cdonts相关.
      

  2.   

    通过身法验证的邮件发送程序:
    -------------------
            Dim objMailMessage As New MailMessage
            objMailMessage.From = TextBox1.Text
            objMailMessage.To = TextBox2.Text
            objMailMessage.Subject = TextBox3.Text
            objMailMessage.Body = "<html><body><img src=""clsusa_0624.jpg""></body></html>"
            objMailMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", 1)
            objMailMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "youmail")
            objMailMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "mypassword")
            SmtpMail.SmtpServer = "smtp.163.com"
            SmtpMail.Send(objMailMessage)
      

  3.   

    http://blog.csdn.net/goody9807/articles/30560.aspx
      

  4.   

    using System;
    using System.Web;
    using System.Web.Mail; public class SystemMail : IMailProvider
    {
    public SystemMail(){}
    private string _adminEmail;
    public string AdminEmail
    {
    get{return _adminEmail;}
    set{_adminEmail = value;}
    } private string _smtpServer = "localhost";
    public string SmtpServer
    {
    get{return _smtpServer;}
    set{_smtpServer = value;}
    } private string _password;
    public string Password
    {
    get{return _password;}
    set{_password = value;}
    } private string _userName;
    public string UserName
    {
    get{return _userName;}
    set{_userName = value;}
    } /// <summary>
    /// 发送Email函数
    /// </summary>
    /// <param name="to">接收人</param>
    /// <param name="from">发送人</param>
    /// <param name="subject">标题</param>
    /// <param name="message">发送信息</param>
    /// <returns></returns>
    public bool Send(string to, string from, string subject, string message)
    {
    try
    {
    MailMessage em = new MailMessage();
    em.To = to;
    em.From = from;
    em.Subject = subject;
    em.Body = message; //Found out how to send authenticated email via System.Web.Mail at http://SystemWebMail.com (fact 3.8)
    if(this.UserName != null && this.Password != null)
    {
    em.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1"); //basic authentication
    em.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", this.UserName); //set your username here
    em.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", this.Password); //set your password here

    } SmtpMail.SmtpServer = this.SmtpServer;
    SmtpMail.Send(em);

    return true;
    }
    catch
    {
    return false;
    }
    }