smtp服务器的ip地址SmtpMail.SmtpServer = "192.168.0.1";

解决方案 »

  1.   

    http://search.csdn.net/Expert/topic/1836/1836901.xml?temp=.2080194
      

  2.   

    SmtpMail.SmtpServer = "smtp.sina.com";
      

  3.   

    http://dotnet.aspx.cc/ShowDetail.aspx?id=E69A82C0-C002-4D2D-9787-5FEBBA47AC8F
      

  4.   

    SmtpMail.SmtpServer 属性属性值
    电子邮件中继服务器的名称。如果没有设置 SmtpServer,则使用本地 SMTP 服务器的名称。备注如果本地 SMTP 服务器(包括在 Windows 2000 和 Windows Server 2003 中)位于阻塞任何直接 SMTP 通信量(通过端口 25)的防火墙之后,则需要查找网络上是否有可用的智能主机能用来中转发往 Internet 的 SMTP 消息。智能主机是一个 SMTP 服务器,它能够中转从内部 SMTP 服务器直接发送到 Internet 的外出电子邮件。智能主机应能同时连接到内部网络和 Internet,以用作电子邮件网关。有关配置本地 SMTP 服务器方面的信息,请参见 MSDN Library 中的文章“Manage Your Company's E-mail with the Windows 2000 SMTP Service”和“Using SMTP for Outgoing Messages”,网址为 http://msdn.microsoft.com。
    示例
    [Visual Basic] 
    ' This example assigns the name of the mail relay server on the 
    ' local network to the SmtpServer property.
    SmtpMail.SmtpServer = "RelayServer.Contoso.com"[C#] 
    //This example assigns the name of the mail relay server on the 
    //local network to the SmtpServer property.
    SmtpMail.SmtpServer = "RelayServer.Contoso.com";
      

  5.   

    现在大多数的smtp服务器都需要验证才能使用。如果使用本机作为测试机器则可以使用127.0.0.1。.NET自带的这个类好像是不支持smtp身份验证的!如果作为测试你可以使用本级作为smtp服务器。否则你可能需要自己实现这种需要验证的模式或者去买一套现在已经成型的产品,比如:aspnetemail或者你可以使用opensource的项目。比如:http://sourceforge.net/projects/opensmtp-net/
      

  6.   

    SmtpMail.SmtpServer 用的是IIS默认的SMTP,如果想指定其他SMTP,用C#的这个是不能实现的,他不能设置用户名密码。如果想指定其他SMTP,不能用C#的SmtpMail。用第三方的组件或者自己写。我有一个自己写的组件,如果要请留下Email。
      

  7.   

    SmtpMail.SmtpServer 用的是IIS默认的SMTP,如果想指定其他SMTP,用C#的这个是不能实现的,他不能设置用户名密码。//可以,用
    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
    具体
    http://blog.csdn.net/zhzuo/archive/2004/07/12/39459.aspx