Gmail SMTP Setup - Error

If you have questions about using mojoPortal, you can post them here.

You may want to first review our site administration documentation to see if your question is answered there.

This thread is closed to new posts. You must sign in to post in the forums.
11/30/2012 10:53:49 AM
Total Posts 10

Gmail SMTP Setup - Error

The email runs from gmail and is stored there as well.

In my web.config:
<add key="SMTPServer" value="" />
 <add key="SMTPRequiresAuthentication" value="true" />
 <add key="SMTPPort" value="465" />
 <add key="SMTPUser" value="" />
 <add key="SMTPPassword" value="*******" />
  <add key="SMTPUseSsl" value="true" />

at the bottom of it: 

            <smtp from="">
                <network host="" port="465" userName="" password="*******" />

Have tried port 587. 
Site email from address is the

Keep getting the following error message in the log:
2012-11-30 11:44:59,805 ERROR mojoPortal.Web.UI.Pages.RecoverPassword - unable to send password recovery email. Please check the MailSettings section in web.config 
System.Net.Mail.SmtpException: Failure sending mail. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
   at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP)
   at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, 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, 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(String host, Int32 port)
   at System.Net.Mail.SmtpTransport.GetConnection(String host, Int32 port)
   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 System.Web.UI.WebControls.LoginUtil.SendPasswordMail(String email, String userName, String password, MailDefinition mailDefinition, String defaultSubject, String defaultBody, OnSendingMailDelegate onSendingMailDelegate, OnSendMailErrorDelegate onSendMailErrorDelegate, Control owner)


11/30/2012 11:35:55 AM
Total Posts 18439

Re: Gmail SMTP Setup - Error


The section settings are no longer used so only the other settings matter.

Note that settings in user.config will trump the ones in web.config

I'm not aware of being able to use custom domains with gmail. I would expect that you would have to use the gmail address in settings and as the from address in site settings.

I really don't think gmail is a good solution for web site email, your mileage may vary on that and they may limit the amount of mail you can relay.

Hope that helps,


You must sign in to post in the forums. This thread is closed to new posts.