Email Error

Hello - I have installed and deployed the FBA pack on two seperate farms. One dev and one production. The Dev one works flawless, everything runs correct and emails are properly sent out. The problem I am having is on the Production side. Everything but the emails work. Even reseting the password works, it just does not send the email that tells the user what the password is. The outgoing emails are set the same only using two different email reply to addresses (And we have verified that the email address is ok for sending to external users). So ulimately when I try to reset the password, I get "There was an error sending the email, please check with your administrator". When I look at the windows logs. I see these.

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 x.x.x.x:443

All normal settings are identicle between production and Dev. The only difference is that production is ssl port 443 and dev is not ssl port 80

Any clues?

Also, the dev server has SQL local to the machine where the prod one is on a seperate server. I assume the connections are ok because it makes changes to the FBA user database and changes the password, just does not send the email.

A few other people have had email + SSL issues, and it turned out to be a certificate not being registered with SharePoint.  Check this thread for details:

http://sharepoint2010fba.codeplex.com/discussions/260121

If that's not the problem, could you post the full errors that are in the SharePoint log - that should tell me where it's failing.

Thank you for your reply. We had done that step before and just to make sure we ran it again this time using powershell instead of central admin for the trust relationship and still have the same error. Here is the sharepoint log for Sharepoint 2010 FBA

 

General                        0000 High     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 X.X.X.X:443     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, Int32 timeout, Exception& exception)     --- End of inner exception stack trace ---     at System.Net.HttpWebRequest.GetResponse()     at System.Xml.XmlDownloadManager.GetNonFileStream(Uri uri, ICredentials ... 27f44b97-d6f2-423a-8f2d-fbf4aaf1c09e
11/21/2011 15:05:49.03* w3wp.exe (0x0660)                        0x1788 SharePoint 2010 FBA Pack       

General                        0000 High     ...credentials)     at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn)     at System.Xml.Xsl.Xslt.XsltLoader.CreateReader(Uri uri, XmlResolver xmlResolver)     at System.Xml.Xsl.Xslt.XsltLoader.Load(Compiler compiler, Object stylesheet, XmlResolver xmlResolver)     at System.Xml.Xsl.Xslt.Compiler.Compile(Object stylesheet, XmlResolver xmlResolver, QilExpression& qil)     at System.Xml.Xsl.XslCompiledTransform.CompileXsltToQil(Object stylesheet, XsltSettings settings, XmlResolver stylesheetResolver)     at System.Xml.Xsl.XslCompiledTransform.LoadInternal(Object stylesheet, XsltSettings settings, XmlResolver stylesheetResolver)     at System.Xml.Xsl.XslCompiledTransform.Load(String stylesheetUri)     at Visigo.Sharepoint.FormsBasedAuthentication.Email.Se... 27f44b97-d6f2-423a-8f2d-fbf4aaf1c09e
11/21/2011 15:05:49.03* w3wp.exe (0x0660)                        0x1788 SharePoint 2010 FBA Pack       

General                        0000 High     ...ndEmail(SPWeb web, String emailTo, String xsltTemplateFile, IDictionary xslValues) 27f44b97-d6f2-423a-8f2d-fbf4aaf1c09e

3 seperate lines for Sharepoint 2010 FBA pack. Also the x.x.x.x:443 is the server hosting the site.

I think it's having problems accessing the email templates, probably a permissions problem. Try visiting the urls defined in FBA Site Settings directly in the browser and see if you can pull up the XSLT files.

I entered it in and it showed the code for the password retreval. It only showed:

Membership Password Recovery You have requested this mail because you have forgotten your password to . Your user name is: Your temporary password is: Your temporary password can be changed immediately by logging onto the Change Password Page using your user name and temporary password. The ChangePassword page is located at . Thank you.

There is an enable content that if I click on that, it shows the entire code for the XSLT file.

Strange. I'd maybe check the alternate access mappings in Central Admin and make sure they're configured properly.  You might also want to wait for version 1.2 to release (should be any time now - i'm just finishing testing) - I've fixed a bug relating to passing credentials to the XSLT download which may be what you're experiencing. Or just download the source and compile yourself to test it out.

Has anyone been able to resolve this? I just updated to 1.2 and I still have the same error as above. I made sure thet the cert was in the trust relationships in sharepoint, but nada. I have a dev site that works fine and the only thing that seems different is that the dev site is http. Any thoughts?

Looks like we got it working. It was the config file that was in another post. It was showing the SMTP server as "" insteasd of having our server in there

 

:) Awesome code and thank you so much

 

I had a similar issue as above and after weeks of troubleshooting finally found my issue. I had the FBA pack working 100% in dev but no matter what i tried couldn’t get it to work in Prod. Was getting an exception

"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 "when it tried to load the XSLT.

The solution for me included the certificate issue above but also was related to the DNS IP address. Our site is NAT'ed behind a firewall and the IP of the server is not the same as the public IP. The IP that the code had gotten was the External IP. Then it clicked, on Dev i had added local host entry’s to test access to the site (hence local DNS IP to 127.0.0.1). After a quick change on production to test, registration and other email related controls worked first time.

With a temporary fix in place, I now need to find something a bit more unwavering.

Hopefully this helps someone else.

Just an FYI, as of version 1.3, the xslt/ssl loading errors should no longer be happening due to a change in the way the xslt is loaded.