大家好,我在试用期内,领导让我实现如下功能,请大侠们一定帮忙!公司有个网站,要求作个邮箱,能够发送外部邮件,就是输入外部E_MAIL,比如输入:[email protected],能够发送到这个邮箱,请帮帮我呀!
就这些分了,请大家不要见怪!

解决方案 »

  1.   

    using System.Web.Mail;
    可以看一下!.NET自带的不过不怎么好!
    我用的是jmail 要下载一个安装文件http://www.mydown.com/code/115/115586.html使用
    http://www.blueidea.com/bbs/newsdetail.asp?id=1036923
      

  2.   

    C# 的
    (in C#) 
    using System.Web.Mail; 
    public void sendMail() 

    try 

    System.Web.Mail.MailMessage myMail=new MailMessage(); 
    myMail.From = "[email protected]"; 
    myMail.To = "[email protected]"; 
    myMail.Subject = "MailTest"; 
    myMail.Priority = MailPriority.Low; 
    myMail.BodyFormat = MailFormat.Text; 
    myMail.Body = "Test"; 
    SmtpMail.SmtpServer="smarthost"; //your smtp server here  SmtpMail.Send(myMail); 

    catch(Exception e) 

    throw e; 

    }
      

  3.   

    http://www.cnblogs.com/goody9807/archive/2005/03/09/115367.html
      

  4.   

    zhangguozhixp(飞翔的菜鸟)的代码是对的,但是建议加上发送者的邮箱的用户名和密码,也就是身份验证,不然很容易被当成垃圾邮件过滤掉。
      

  5.   

    ......
    //创建对象
    MailMessage myMail = new MailMessage();
    //发送服务器
    SmtpMail.SmtpServer="smtp.sina.com.cn";
    //认证
    myMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate","1");
    //用户名
    myMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername","luck");
    //密码
    myMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword","xxx");
    //收信人
    myMail.To=txtTo.Text.Trim();//收信人
    //寄信人
    myMail.From=txtFrom.Text.Trim();
    //主题
    myMail.Subject=txtTitle.Text.Trim();
    //内容
    myMail.Body=txtContent.Text;
    //正文格式
    myMail.BodyFormat=MailFormat.Text;
    //优先级
    myMail.Priority=MailPriority.High;
    //发送
    SmtpMail.Send(myMail);
    ......
      

  6.   

    建议采用Jmail,或CDOhttp://www.chinamacro.com/blog/visit_detail.aspx?blogID=13
      

  7.   

    MailMessage myMail = new MailMessage();
    myMail.From="[email protected]";
    myMail.To="[email protected]";
    myMail.Subject="test";
    myMail.BodyFormat = MailFormat.Html;
    myMail.Body="<html><body>test!test!</body></html>";
    MailAttachment myAttachment = new MailAttachment("e:/songlin.mdb", MailEncoding.Base64);
    myMail.Attachments.Add(myAttachment);
    SmtpMail.SmtpServer="smtp.163.com";
    try
    {
    SmtpMail.Send(myMail);
    }
    catch
    {
    Response.Write("<script language='javascript'> alert('未能发送成功!')</script>");
    }
    大家看这个错在哪?
    发送不成功啊
      

  8.   

    我采用了luck0235大哥的做法,现在有2个疑问还想问各位大哥:
    1、我发送给新浪油箱后进入后“不明邮件”,如何不进入“不明邮件”而是直接进入“未读邮件”
    2、我发给163.com后发送是成功了,可是怎么收不到呢