none
System.Net.WebException: : The remote name could not be resolved (asp.net 3.5 , c#) RRS feed

  • Question

  • I tried to send email in my site(asp.net 3.5 ,c#):

    I have this in web.config:

     <system.net>
        <mailSettings>
          <smtp deliveryMethod="Network" >
            <network host="smtp.nimanaqipour.com" userName="Nimanaqipour" password="mypass" port="21" />
          </smtp>
        </mailSettings>

      </system.net>

    but I got this Error:

     

     

    Server Error in '/' Application.

    The remote name could not be resolved: 'smtp.nimanaqipour.com'

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Net.WebException: The remote name could not be resolved: 'smtp.nimanaqipour.com'

    Source Error:

    Line 31: 
    Line 32:   SmtpClient mySmtpClient = new SmtpClient();
    Line 33:   mySmtpClient.Send(myMessage);
    
    
    Line 34:  }
    Line 35: }

    Source File: c:\inetpub\whosts\nimanaqipour.com\httpdocs\Index.aspx.cs    Line: 33

    Stack Trace:

    [WebException: The remote name could not be resolved: 'smtp.nimanaqipour.com']
     System.Net.ServicePoint.GetConnection(PooledStream PooledStream, Object owner, Boolean async, IPAddress& address, Socket& abortSocket, Socket& abortSocket6, Int32 timeout) +5483851
     System.Net.PooledStream.Activate(Object owningObject, Boolean async, Int32 timeout, GeneralAsyncDelegate asyncCallback) +202
     System.Net.PooledStream.Activate(Object owningObject, GeneralAsyncDelegate asyncCallback) +21
     System.Net.ConnectionPool.GetConnection(Object owningObject, GeneralAsyncDelegate asyncCallback, Int32 creationTimeout) +332
     System.Net.Mail.SmtpConnection.GetConnection(String host, Int32 port) +160
     System.Net.Mail.SmtpTransport.GetConnection(String host, Int32 port) +159
     System.Net.Mail.SmtpClient.GetConnection() +35
     System.Net.Mail.SmtpClient.Send(MailMessage message) +1213
    
    [SmtpException: Failure sending mail.]
     System.Net.Mail.SmtpClient.Send(MailMessage message) +1531
     _Default.Button1_Click(Object sender, EventArgs e) in c:\inetpub\whosts\nimanaqipour.com\httpdocs\Index.aspx.cs:33
     System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
     System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
     System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
     System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
     System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
     System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
    

     

    Tuesday, July 13, 2010 12:53 PM

Answers

  • That means the computer asked for the IP-address of smtp.nimanaqipour.com at your configurated DNS server and this returned it couldn't find an IP-address for smtp.nimanaqipour.com

    So question is: is smtp.nimanaqipour.com a valid address?

    Is there a DNS server configured at the computer and has this DNS server a valid DNS entry for smtp.nimanaqipour.com

    • Marked as answer by Nima naqipoor Thursday, July 15, 2010 10:56 AM
    Tuesday, July 13, 2010 2:16 PM
  • Seems like a DNS problem.

    From the command line of that server, can you successfully do "nslookup theHostNameFromYourPost"?

    If this does not work either, double check the host name and consult with networking personnel.

     

     

    • Marked as answer by Nima naqipoor Thursday, July 15, 2010 10:56 AM
    Tuesday, July 13, 2010 2:17 PM

All replies

  • That means the computer asked for the IP-address of smtp.nimanaqipour.com at your configurated DNS server and this returned it couldn't find an IP-address for smtp.nimanaqipour.com

    So question is: is smtp.nimanaqipour.com a valid address?

    Is there a DNS server configured at the computer and has this DNS server a valid DNS entry for smtp.nimanaqipour.com

    • Marked as answer by Nima naqipoor Thursday, July 15, 2010 10:56 AM
    Tuesday, July 13, 2010 2:16 PM
  • Seems like a DNS problem.

    From the command line of that server, can you successfully do "nslookup theHostNameFromYourPost"?

    If this does not work either, double check the host name and consult with networking personnel.

     

     

    • Marked as answer by Nima naqipoor Thursday, July 15, 2010 10:56 AM
    Tuesday, July 13, 2010 2:17 PM
  • Hi,

      Thanks for your post. Please consider http://forums.asp.net/ as a better option.


    Please mark the right answer at right time.
    Thanks,
    Sam
    Wednesday, July 14, 2010 3:33 AM