Email SMTP configuration failure

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/7/2008 3:42:42 AM
Gravatar
Total Posts 14

Email SMTP configuration failure

I'm configuring email smtp settings in web.config to send an email during registration of new users.

In the appSettings section:

<add key="SMTPServer" value="mail.mydomain.it" />
<add key="SMTPRequiresAuthentication" value="false" />
<add key="SMTPUseSsl" value="false" />
<add key="SMTPPort" value="25" />
<add key="SMTPUser" value="UserName" />
<add key="SMTPPassword" value="UPassword" />
<add key="SMTPTimeoutInMilliseconds" value="15000" />
<!-- leave this blank for ascii encoding -->
<add key="SmtpPreferredEncoding" value="" />

and in system.net section:

<system.net>
<mailSettings>
<smtp from="my@mail.it">
<network
host="mail.mydomain.it"
port="25"
password=""
userName=""
/>
</smtp>
</mailSettings>
</system.net>

But emails are not correctly sent. I see in my log that an email is sent but it has empty subject and from = noreply@etc.. so my server rejected it as spam.

Are there more settings to apply? Why from is yet noreply, and where I can set the subject?

Thanks

11/7/2008 4:25:53 AM
Gravatar
Total Posts 18439

Re: Email SMTP configuration failure

Hi,

You can and should specify the default email from address in Administration Menu > Site Settings

That "may" solve the spam filter problem. It can also depend on what mail server you are using, some spam filters do a reverse lookup to make sure it was sent from the correct mail server.

Unfortunately, at the moment the subject for the registration email is not configurable, it will just use the site name, so I don't know why it is blank.

The body of the email is configurable in the sense that it can be localized, but not really customized. It will use the text template file /Data/MessageTemplates/en-US-RegisterConfirmEmailMessage.config

if the default culture as configured in Web.config is not en-US, it will look for a file with the current default culture.

Its not really customizable because next time you upgrade the files will be overwritten and any customization would be lost.

Hope it helps,

Joe

11/7/2008 5:40:22 AM
Gravatar
Total Posts 14

Re: Email SMTP configuration failure

But now Mojoportal gives me this error if I make a new registration:

We're sorry but a server error has occurred while trying to process your request.

The error has been logged and will be reviewed by our staff as soon as possible. It is possible that the error was just a momentary hiccup and you may wish to use the back button and try again or go back to the home page.

 

And at the same time, the email has been sent, I received it, the subject is "no subject", and I can regulary confirm the registration

11/7/2008 5:44:57 AM
Gravatar
Total Posts 18439

Re: Email SMTP configuration failure

That doesn't tell me anything. You need to check the log for the error details.

You can access the log from Administration Menu > System Log

Note that the newest errors are at the bottom of the log.

Please do not post your whole log here. Best to clear the log then test registration to cause the error then paste the log with only the newest errors so I can see the error.

Hope it helps,

Joe

11/7/2008 5:45:59 AM
Gravatar
Total Posts 14

Re: Email SMTP configuration failure

Even if that error occurred the email has been sent, I received it, the subject is "no subject", and I can regulary confirm the registration

11/7/2008 5:56:32 AM
Gravatar
Total Posts 14

Re: Email SMTP configuration failure

This is the error in the log:

at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
2008-11-07 12:52:34,457 [344] ERROR mojoPortal.Web.Global [(null)] - 85.18.241.85-it-IT - /mojoportal/Secure/Register.aspx
System.IndexOutOfRangeException: Field not found

Can you help me to undestrand the problem?

11/7/2008 5:58:30 AM
Gravatar
Total Posts 18439

Re: Email SMTP configuration failure

Is that the whole error message? Please post the whole thing.

Thanks,

Joe

11/7/2008 6:00:32 AM
Gravatar
Total Posts 14

Re: Email SMTP configuration failure

2008-11-07 12:52:34,332 [344] ERROR mojoPortal.Web.mojoBasePage [(null)] - 85.18.241.85-it-IT - /mojoportal/Secure/Register.aspx
System.IndexOutOfRangeException: Field not found
at Npgsql.NpgsqlDataReader.get_Item(String name)
at mojoPortal.Business.SiteUser.GetRoleMembers(Int32 roleId)
at mojoPortal.Web.NotifyAdminUserRegisteredHandler.UserRegisteredHandler(Object sender, UserRegisteredEventArgs e)
at mojoPortal.Business.UserRegistreredEventHandler.Invoke(Object sender, UserRegisteredEventArgs e)
at mojoPortal.Web.UI.Pages.Register.OnUserRegistered(UserRegisteredEventArgs e)
at mojoPortal.Web.UI.Pages.Register.RegisterUser_CreatedUser(Object sender, EventArgs e)
at System.Web.UI.WebControls.CreateUserWizard.OnCreatedUser(EventArgs e)
at System.Web.UI.WebControls.CreateUserWizard.AttemptCreateUser()
at System.Web.UI.WebControls.CreateUserWizard.OnNextButtonClick(WizardNavigationEventArgs e)
at System.Web.UI.WebControls.Wizard.OnBubbleEvent(Object source, EventArgs e)
at System.Web.UI.WebControls.CreateUserWizard.OnBubbleEvent(Object source, EventArgs e)
at System.Web.UI.WebControls.Wizard.WizardChildTable.OnBubbleEvent(Object source, EventArgs args)
at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
at System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs 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-11-07 12:52:34,457 [344] ERROR mojoPortal.Web.Global [(null)] - 85.18.241.85-it-IT - /mojoportal/Secure/Register.aspx
System.IndexOutOfRangeException: Field not found
at Npgsql.NpgsqlDataReader.get_Item(String name)
at mojoPortal.Business.SiteUser.GetRoleMembers(Int32 roleId)
at mojoPortal.Web.NotifyAdminUserRegisteredHandler.UserRegisteredHandler(Object sender, UserRegisteredEventArgs e)
at mojoPortal.Business.UserRegistreredEventHandler.Invoke(Object sender, UserRegisteredEventArgs e)
at mojoPortal.Web.UI.Pages.Register.OnUserRegistered(UserRegisteredEventArgs e)
at mojoPortal.Web.UI.Pages.Register.RegisterUser_CreatedUser(Object sender, EventArgs e)
at System.Web.UI.WebControls.CreateUserWizard.OnCreatedUser(EventArgs e)
at System.Web.UI.WebControls.CreateUserWizard.AttemptCreateUser()
at System.Web.UI.WebControls.CreateUserWizard.OnNextButtonClick(WizardNavigationEventArgs e)
at System.Web.UI.WebControls.Wizard.OnBubbleEvent(Object source, EventArgs e)
at System.Web.UI.WebControls.CreateUserWizard.OnBubbleEvent(Object source, EventArgs e)
at System.Web.UI.WebControls.Wizard.WizardChildTable.OnBubbleEvent(Object source, EventArgs args)
at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
at System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs 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-11-07 12:52:34,473 [344] ERROR mojoPortal.Web.Global [(null)] - 85.18.241.85-it-IT - /mojoportal/Secure/Register.aspx
System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.IndexOutOfRangeException: Field not found
at Npgsql.NpgsqlDataReader.get_Item(String name)
at mojoPortal.Business.SiteUser.GetRoleMembers(Int32 roleId)
at mojoPortal.Web.NotifyAdminUserRegisteredHandler.UserRegisteredHandler(Object sender, UserRegisteredEventArgs e)
at mojoPortal.Business.UserRegistreredEventHandler.Invoke(Object sender, UserRegisteredEventArgs e)
at mojoPortal.Web.UI.Pages.Register.OnUserRegistered(UserRegisteredEventArgs e)
at mojoPortal.Web.UI.Pages.Register.RegisterUser_CreatedUser(Object sender, EventArgs e)
at System.Web.UI.WebControls.CreateUserWizard.OnCreatedUser(EventArgs e)
at System.Web.UI.WebControls.CreateUserWizard.AttemptCreateUser()
at System.Web.UI.WebControls.CreateUserWizard.OnNextButtonClick(WizardNavigationEventArgs e)
at System.Web.UI.WebControls.Wizard.OnBubbleEvent(Object source, EventArgs e)
at System.Web.UI.WebControls.CreateUserWizard.OnBubbleEvent(Object source, EventArgs e)
at System.Web.UI.WebControls.Wizard.WizardChildTable.OnBubbleEvent(Object source, EventArgs args)
at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
at System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs 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.secure_register_aspx.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
 

11/7/2008 6:09:13 AM
Gravatar
Total Posts 18439

Re: Email SMTP configuration failure

Ok, I see the problem now. It is a bug in the pgsql data layer. I will fix this today so it will be fixed in the next release probably coming in the next few weeks.

In the meantime, the only thing I can suggest to prevent the error is set this to false in Web.config/user.config:

<add key="NotifyAdminsOnNewUserRegistration" value="false" />

The bug is in the sql for looking up the admins to send the notification so disabling this should prevent the error.

I still don't know why the subject is blank on the registration email, that is a different issue than this error.

Best,

Joe

11/7/2008 6:18:51 AM
Gravatar
Total Posts 14

Re: Email SMTP configuration failure

Thanks so much!

11/7/2008 7:04:09 AM
Gravatar
Total Posts 14

Re: Email SMTP configuration failure

Ok I set this to false

<add key="NotifyAdminsOnNewUserRegistration" value="false" />

and now everythink is ok.

The problem of the empty subject is caused by the fact that I didn't give a name to my site because it appears like text in the header, but I have the name in the logo so now there are two names (one in the logo image and one written on it). Must I modify it in the skin?

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