Email Problems - Contact Us form

Post here for help with installing or upgrading mojoPortal pre-compiled release packages. When posting in this forum, please provide all relevant details. You may also want to review the installation or upgrading documentation.

If you have questions about using the source code or working with mojoPortal in Visual Studio, please post in the Developer forum.

Post here for help with installation of mojoPortal pre-compiled release packages

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.

You may also want to review the installation or upgrading documentation.

If you have questions about using the source code or working with mojoPortal in Visual Studio, please post in the Developer forum.

This thread is closed to new posts. You must sign in to post in the forums.
8/4/2008 8:18:42 AM
Gravatar
Total Posts 72

Email Problems - Contact Us form

Hi

Can't seem to configure email properly - I have put the settings into web.config - and double checked against other websites I have sending mail to me but I get an error which I just can't figure out - see below.

"An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)"

On the page settings I have included an email for contact us forms to be sent to.

Not having any luck - probably really simple.

Chris

8/4/2008 8:41:52 AM
Gravatar
Total Posts 18439

Re: Email Problems - Contact Us form

Hi Chris,

That doesn't look anything like an email error. Something else db related is going on but not enough detail in the message. Can you find the error in the mojoportal log and post the stack trace?

Best,

Joe

8/4/2008 6:21:59 PM
Gravatar
Total Posts 72

Re: Email Problems - Contact Us form

Hi Joe,

Here is the stack trace - makes no sense to me.

------------------

2008-08-04 17:20:26,406 [5804] ERROR mojoPortal.Web.mojoBasePage [(null)] - 59.101.179.15-en-GB - /contact-us.aspx?pageid=18
System.Data.SqlClient.SqlException: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject)
at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject)
at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart)
at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)
at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)
at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.SqlClient.SqlConnection.Open()
at SubSonic.SqlDataProvider.CreateConnection(String newConnectionString)
at SubSonic.SqlDataProvider.CreateConnection()
at SubSonic.AutomaticConnectionScope..ctor(DataProvider provider)
at SubSonic.SqlDataProvider.ExecuteScalar(QueryCommand qry)
at SubSonic.ActiveRecord`1.Save(String userName)
at SubSonic.ActiveRecord`1.Save()
at mojoPortal.Data.Common.DBContactFormMessage.Create(Guid rowGuid, Guid siteGuid, Guid moduleGuid, String email, String url, String subject, String message, DateTime createdUtc, String createdFromIpAddress, Guid userGuid)
at mojoPortal.Data.DBContactFormMessage.Create(Guid rowGuid, Guid siteGuid, Guid moduleGuid, String email, String url, String subject, String message, DateTime createdUtc, String createdFromIpAddress, Guid userGuid)
at mojoPortal.Business.ContactFormMessage.Create()
at mojoPortal.Business.ContactFormMessage.Save()
at mojoPortal.Web.ContactUI.ContactForm.btnSend_Click(Object sender, EventArgs e)
at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
2008-08-04 17:20:26,484 [5804] ERROR mojoPortal.Web.Global [(null)] - 59.101.179.15-en-GB - /contact-us.aspx?pageid=18
System.Data.SqlClient.SqlException: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject)
at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject)
at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart)
at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)
at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)
at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.SqlClient.SqlConnection.Open()
at SubSonic.SqlDataProvider.CreateConnection(String newConnectionString)
at SubSonic.SqlDataProvider.CreateConnection()
at SubSonic.AutomaticConnectionScope..ctor(DataProvider provider)
at SubSonic.SqlDataProvider.ExecuteScalar(QueryCommand qry)
at SubSonic.ActiveRecord`1.Save(String userName)
at SubSonic.ActiveRecord`1.Save()
at mojoPortal.Data.Common.DBContactFormMessage.Create(Guid rowGuid, Guid siteGuid, Guid moduleGuid, String email, String url, String subject, String message, DateTime createdUtc, String createdFromIpAddress, Guid userGuid)
at mojoPortal.Data.DBContactFormMessage.Create(Guid rowGuid, Guid siteGuid, Guid moduleGuid, String email, String url, String subject, String message, DateTime createdUtc, String createdFromIpAddress, Guid userGuid)
at mojoPortal.Business.ContactFormMessage.Create()
at mojoPortal.Business.ContactFormMessage.Save()
at mojoPortal.Web.ContactUI.ContactForm.btnSend_Click(Object sender, EventArgs e)
at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
2008-08-04 17:20:26,500 [5804] ERROR mojoPortal.Web.Global [(null)] - 59.101.179.15-en-GB - /contact-us.aspx?pageid=18
System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.Data.SqlClient.SqlException: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject)
at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject)
at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart)
at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)
at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)
at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.SqlClient.SqlConnection.Open()
at SubSonic.SqlDataProvider.CreateConnection(String newConnectionString)
at SubSonic.SqlDataProvider.CreateConnection()
at SubSonic.AutomaticConnectionScope..ctor(DataProvider provider)
at SubSonic.SqlDataProvider.ExecuteScalar(QueryCommand qry)
at SubSonic.ActiveRecord`1.Save(String userName)
at SubSonic.ActiveRecord`1.Save()
at mojoPortal.Data.Common.DBContactFormMessage.Create(Guid rowGuid, Guid siteGuid, Guid moduleGuid, String email, String url, String subject, String message, DateTime createdUtc, String createdFromIpAddress, Guid userGuid)
at mojoPortal.Data.DBContactFormMessage.Create(Guid rowGuid, Guid siteGuid, Guid moduleGuid, String email, String url, String subject, String message, DateTime createdUtc, String createdFromIpAddress, Guid userGuid)
at mojoPortal.Business.ContactFormMessage.Create()
at mojoPortal.Business.ContactFormMessage.Save()
at mojoPortal.Web.ContactUI.ContactForm.btnSend_Click(Object sender, EventArgs e)
at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
--- End of inner exception stack trace ---
at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at ASP.default_aspx.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

8/5/2008 6:06:36 AM
Gravatar
Total Posts 18439

Re: Email Problems - Contact Us form

Hi Chris,

Look in the bottom of your Web.config file for this connection string:

<add name="Subsonic-MSSqlServer" connectionString="server=(local);UID=sa;PWD=foo;database=ztest1" />

set the value of connectionstring to the same thing you have in this setting from the appSettings section of Web.config or from user.config if using a user.config file:

<add key="MSSQLConnectionString" value="server=(local);UID=mojouser;PWD=mojo123;database=mojoportal" />

ie copy from value= to connectionString=

using the correct connection string for your db

and let me know if that fixes it or not.

Thanks,

Joe

8/5/2008 7:35:37 AM
Gravatar
Total Posts 72

Re: Email Problems - Contact Us form

Hi Joe,

Have done that and still getting the same error.   Am using MYSQL as a database so copied to that ADD NAME as well but still the same error (or looks the same).  Clicking on the View Messages link when signed in as Admin doesn't show any messages so nothing I am trying to send is saving to the database - yet the database is writable as I can create pages and content.

Just another question re the contact form - can you make all the fields mandatory?  Is it easy to add another field such as post code (Zip)?

Cheers - Chris

 

 

8/5/2008 7:38:23 AM
Gravatar
Total Posts 18439

Re: Email Problems - Contact Us form

If I had known you were using MySql my diagnosis would have been different. The errors are clearly MS SQL errors not MySql. You need to set this in Web.config or user.config

<add key="SubSonicProvider" value="subsonicMySql" />

Currently it must be configured for subsonicMSSQL

Hope it helps,

Joe

8/5/2008 8:31:05 AM
Gravatar
Total Posts 72

Re: Email Problems - Contact Us form

Doh

That fixed the error - yes my mistake - forgot to change it to mysql.  HAve tested and all works fine except not actually getting an email - will give it some time to see if comes through.

Cheers - Chris

8/5/2008 8:46:33 AM
Gravatar
Total Posts 18439

Re: Email Problems - Contact Us form

Whether you get the email will be determined by if you have valid smtp settings in Web.config. I would look in the mojoportal log for email errors. If you see errors then its probably not configured correctly.

http://www.mojoportal.com/emailconfiguration.aspx

Hope it helps,

Joe

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