Until yesterday i had a mail server on my server, then I decided to switch to Google apps.
From then, troubles has begun to appear.
I replaced my localhost information in web.config with this:
<add key="EnableSiteSettingsSmtpSettings" value="false"/>
<add key="MaskSmtpPasswordInSiteSettings" value="false"/>
<add key="DisableDotNetOpenMail" value="true"/>
<add key="SMTPServer" value="smtp.gmail.com"/>
<add key="SMTPRequiresAuthentication" value="true"/>
<add key="SMTPUseSsl" value="true"/>
<add key="SMTPPort" value="587"/>
<add key="SMTPUser" value="***"/>
<add key="SMTPPassword" value="***"/>
<add key="SMTPTimeoutInMilliseconds" value="30000"/>
everything seems to work, but does not send anything (and no messages on the system log)
then, i disabled dotnetopenmail, and i get an error 500 and this cryptic line in the system log:
504 Unrecognized authentication type
I enabled the SiteSettingsSmtpSettings, and i inputted the internal ip address of an email server that is running on a vm on the server (telnetting that address on port 25 works, and can send email)
when commenting a blog entry, i receive the notification. it works! i thought.
Then i tried to recover the password of a bogus user that i created for testing purposes, but i get this error:
2010-09-20 16:44:34,793 ERROR mojoPortal.Web.UI.Pages.RecoverPassword - unable to send password recovery email. Please check the system.net MailSettings section in web.config
System.Net.Mail.SmtpException: Error during email send. ---> System.Net.WebException: Impossible connect to the remote computer. ---> System.Net.Sockets.SocketException: Impossible to connnect. The destination computer has refused the connection: 127.0.0.1:25
in System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
in System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)
--- Fine della traccia dello stack dell'eccezione interna ---
in System.Net.ServicePoint.GetConnection(PooledStream PooledStream, Object owner, Boolean async, IPAddress& address, Socket& abortSocket, Socket& abortSocket6, Int32 timeout)
in System.Net.PooledStream.Activate(Object owningObject, Boolean async, Int32 timeout, GeneralAsyncDelegate asyncCallback)
in System.Net.PooledStream.Activate(Object owningObject, GeneralAsyncDelegate asyncCallback)
in System.Net.ConnectionPool.GetConnection(Object owningObject, GeneralAsyncDelegate asyncCallback, Int32 creationTimeout)
in System.Net.Mail.SmtpConnection.GetConnection(ServicePoint servicePoint)
in System.Net.Mail.SmtpClient.Send(MailMessage message)
--- Fine della traccia dello stack dell'eccezione interna ---
in System.Net.Mail.SmtpClient.Send(MailMessage message)
in System.Web.UI.WebControls.LoginUtil.SendPasswordMail(String email, String userName, String password, MailDefinition mailDefinition, String defaultSubject, String defaultBody, OnSendingMailDelegate onSendingMailDelegate, OnSendMailErrorDelegate onSendMailErrorDelegate, Control owner)
Why it is connecting on localhost??? And only when recovering the password? I cannot understand this