Click here to Skip to main content
15,890,506 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have Hosted MVC4 Application in Windows Server 2003 which is our Local Server...

The Entire functionality is working fine except mails functionality...

The Mails functionality working fine in my local machine which i had developed my project in MVC4..

But the same thing(Mails functionality) is not working in our local Server...

The exception is like this

System.Net.WebException: The remote name could not be resolved: 'send.one.com' at System.Net.ServicePoint.GetConnection(PooledStream PooledStream, Object owner, Boolean async, IPAddress& address, Socket& abortSocket, Socket& abortSocket6, Int32 timeout) at System.Net.PooledStream.Activate(Object owningObject, Boolean async, Int32 timeout, GeneralAsyncDelegate asyncCallback) at System.Net.PooledStream.Activate(Object owningObject, GeneralAsyncDelegate asyncCallback) at System.Net.ConnectionPool.GetConnection(Object owningObject, GeneralAsyncDelegate asyncCallback, Int32 creationTimeout) at System.Net.Mail.SmtpConnection.GetConnection(ServicePoint servicePoint) at System.Net.Mail.SmtpTransport.GetConnection(ServicePoint servicePoint) at System.Net.Mail.SmtpClient.GetConnection() at System.Net.Mail.SmtpClient.Send(MailMessage message)

I have searched everywhere regarding this issue everyone says this problem was occurring because of not valid DNS Server Configuration also in this server we don't have the static IP.

But i have a doubt regarding this solution that is in my local machine is also not have static IP then how it works ...

please let me know the what exact reason to getting issue with sending mails in my loacl server.

I am giving the code which we have written for sending mails....

--- Code behind

C#
public string SendMail(string sTo, string sSub, string sBody, string sIsHtml) {
            string sRetMsg = string.Empty;
            System.Net.Mail.MailMessage mailObj = new System.Net.Mail.MailMessage(FrmAddrss, sTo, sSub, sBody);
            if (sIsHtml.Equals("Y"))
                mailObj.IsBodyHtml = true;
            
            SmtpClient SMTPServer = new SmtpClient();
            
            try {
                SMTPServer.Send(mailObj);
            }
            catch (Exception Ex) {
                return Ex.Message + "<br/>" + Ex.InnerException;
            }
            return sRetMsg;
        }



--- Web.confing

XML
<system.net>
    <mailSettings>
      <smtp from="test@pratasolutions.com">
        <network host="testhostname" port="25" userName="test@pratasolutions.com" password="testpassword" />
      </smtp>
    </mailSettings>
  </system.net>



Thanks in advance...
Posted
Updated 10-Jun-14 20:48pm
v3
Comments
Kornfeld Eliyahu Peter 11-Jun-14 3:07am    
According to the error the name 'send.one.com' can not be resolved to an address. Check the network! You may try to put IP address instead of name to test...
Richard MacCutchan 11-Jun-14 4:30am    
The network address send.one.com does not exist. Where did you find it?
K.Venkateswarlu 11-Jun-14 5:08am    
send.one.com is nothing but a host name
Prasad Khandekar 11-Jun-14 5:47am    
Are you able to ping to send.one.com? If not try using the correct IP instead.
Richard MacCutchan 11-Jun-14 12:12pm    
But it does not exist, so how do you expect to use it to send email?

1 solution

host name issue
please check that
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900