能否把完整的工程文件夹发给我,
我可以试一试啊,另外我看了一下以前的问题,
好像没有解决带身份验证的发邮件问题啊。请指点,谢谢
另外我看到一篇好像有人说可以用的,但是我的结果是,提示发送成功,但是
收件箱里收不到,程序如下: MailMessage aMessage = new System.Web.Mail.MailMessage();
aMessage.From = "[email protected]";
aMessage.To = "[email protected]";

aMessage.Subject ="cansuccess?";
aMessage.Body = "cansuccess?";
   
           aMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1");
             aMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserver", "liyouxin.com");
             aMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "user");
                  aMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "pwd"); System.Web.Mail.SmtpMail.Send(aMessage);请指点

解决方案 »

  1.   

    try
    {
    if(TextBox1.Text=="")
    {
    LblMsg.Text="目标邮箱不能为空。";
    return;
    }
    MailMessage Message = new MailMessage();
    Message.To =TextBox1.Text; //发送到
    Message.From = "[email protected]"; //本地邮箱
    Message.Subject = TextBox2.Text; //邮件主题
    Message.Body = TextBox3.Text; //邮件内容; //加入附件
    if(File1.PostedFile.FileName != "")
    {
    MailAttachment attach=new MailAttachment(File1.PostedFile.FileName);
    Message.Attachments.Add(attach);
    } SmtpMail.SmtpServer = "smpt.xx.xx"; //Smtp服务器地址
    SmtpMail.Send(Message); //发送
    LblMsg.Text="发送完毕。";
    }
    catch
    {
    LblMsg.Text="发送失败。";
    }
      

  2.   

    参考
    http://blog.csdn.net/zhzuo/archive/2004/07/12/39459.aspx
    如果需要套接字的请写信给我。
      

  3.   

    MailMessage aMessage = new MailMessage();
    aMessage.From = "[email protected]";
    aMessage.To = "[email protected]";

    aMessage.Subject ="cansuccess?";
    aMessage.Body = "cansuccess?";
       
               aMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1");
                 aMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "user");
                      aMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "pwd");
    SmtpMail.SmtpServer = "liyouxin.com";
    SmtpMail.Send(aMessage);为什么我还是发不出邮件
      

  4.   

    http://blog.csdn.net/kenMoxi/archive/2004/08/18/77810.aspx
    看看那里面的~
      

  5.   

    to andyzc:这几句有问题:
      aMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "你的邮箱帐户");
                      aMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "密码");
    SmtpMail.SmtpServer = "正确的smtpServer";你可以看
    SmtpMail.Send(aMessage);
    这句是否出错!
      

  6.   

    我using jmail,
    可是找不到jmail,
    怎么添加jmail?
      

  7.   

    to lihonggen()
     帐户,密码和服务器我都正确填写了啊,
    你的意思是什么?
    你试过了么,你的可以用么?
      

  8.   

    当然可以,前提是必须配置正确
    比如说SmtpServer,用户名和密码
      

  9.   

    to miqier:你的那个我试过了,
    程序倒是提示发送成功,可是根本收不到邮件,
    而且我发现,在编辑矿里填写无效的用户名和密码也提示发送成功,
    你试过了么?
      

  10.   

    to lihonggen:那我真是见鬼了,我的用户名,密码,和smtpserver
    都是按照outlook填写的啊,用outlook可以正常发送,
    那我也应该可以正常发送啊,这是怎么回事啊,急死我了,
    都搞了1天半了,愣是没有发出一封邮件