cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Contact us form in asp.net email not send using gmail geeting error

System.Net.Mail.SmtpException: Failure sending mail. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: An attempt was made to access a socket in a way forbidden by its access permissions 74.125.200.109:587 at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception) --- End of inner exception stack trace --- at System.Net.ServicePoint.GetConnection(PooledStream PooledStream, Object owner, Boolean async, IPAddress& address, Socket& abortSocket, Socket& abortSocket6) at System.Net.PooledStream.Activate(Object owningObject, Boolean async, 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) --- End of inner exception stack trace --- at System.Net.Mail.SmtpClient.Send(MailMessage message) at Index.ClientMailToMyMail() in g:\pleskvhosts\kishanchef.in\httpdocs\Index.aspx.cs:line 68System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: An attempt was made to access a socket in a way forbidden by its access permissions 74.125.200.109:587 at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception) --- End of inner exception stack trace --- at System.Net.ServicePoint.GetConnection(PooledStream PooledStream, Object owner, Boolean async, IPAddress& address, Socket& abortSocket, Socket& abortSocket6) at System.Net.PooledStream.Activate(Object owningObject, Boolean async, 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)System.Net.Sockets.SocketException (0x80004005): An attempt was made to access a socket in a way forbidden by its access permissions 74.125.200.109:587 at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)

 
 
5 REPLIES 5
Helper VI
Helper VI

Re: Contact us form in asp.net email not send using gmail geeting error

Hello @nanakchand

 

Please take a look here https://uk.godaddy.com/help/what-is-the-name-of-my-hosting-accounts-relay-server-953 and tell us what relay server have you used.

 

🙂

 

***Signature: -> Do not assume anything! If you want help, explain your problem. If my post helped you, give it a Kudo. If you have the solution, mark the topic as Solved.

Re: Contact us form in asp.net email not send using gmail geeting error

  MailAddress address = new MailAddress("email@gmail.com ");
        mail.From = address;

        mail.Subject = "Contact US Details of Clients";
        mail.SubjectEncoding = System.Text.Encoding.UTF8;
        mail.IsBodyHtml = true;
        mail.Body = "Hello," ;

        //Configure an SmtpClient to send the mail.  

        SmtpClient smtp = new SmtpClient();
        smtp.DeliveryMethod = SmtpDeliveryMethod.Network;
        smtp.EnableSsl = true;
        smtp.Host = "smtp.gmail.com";
        smtp.Port = 25;

        mail.Priority = MailPriority.High;


        //Setup credentials to login to our sender email address ("UserName", "Password")

        NetworkCredential credentials = new NetworkCredential(from, pwd);
        smtp.UseDefaultCredentials = true;
        smtp.Credentials = credentials;
       

 

 

this are the C# code email not send

please help

Helper VI
Helper VI

Re: Contact us form in asp.net email not send using gmail geeting error

Try to replace smtp.gmail.com with relay-hosting.secureserver.net and see if it's working.

 

Good luck.

🙂

***Signature: -> Do not assume anything! If you want help, explain your problem. If my post helped you, give it a Kudo. If you have the solution, mark the topic as Solved.

Re: Contact us form in asp.net email not send using gmail geeting error

That doesnt work either.

Im getting 

An attempt was made to access a socket in a way forbidden by its access permissions 40.97.121.18:58

Re: Contact us form in asp.net email not send using gmail geeting error

I am also facing this error ...

relay-hosting.secureserver.net not working..

Please solve