Smtp email not working for New Registration setting

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.
7/7/2011 6:49:12 AM
Gravatar
Total Posts 10

Smtp email not working for New Registration setting

Hi all,

I've recently upgraded mojoPortal to the latest release from an ancient .net 2 project in order to satisfy a customer need for Admins to approve registrations manually since this feature was recently added as a Site Setting to MP.

Unfortunately I cannot seem to get the email notification part of this setting to work.  I have tested email through the Contact feature which seems to work fine, yet the New Registration email to Admins (or the custom email address(es)) does not work.

I have enabled "ALL" logging to see if there was an SMTP email error of some kind but nothing is coming up at all, it is as if the notification is not even been sent by MP.

Any help would be appreciated.

 

System Information
mojoPortal Version 2.3.6.7 MSSQL
Operating System Microsoft Windows NT 5.2.3790 Service Pack 2

 

Cheers,

Chris

7/7/2011 7:18:55 AM
Gravatar
Total Posts 18439

Re: Smtp email not working for New Registration setting

The email addresses to receive notifications used to be a config setting but now it is in Site Settings. Have you entered any addresses to receive the notifications in Site Settings?

Hope that helps,

Joe

7/7/2011 8:19:42 AM
Gravatar
Total Posts 10

Re: Smtp email not working for New Registration setting

Thanks for the reply Joe.

Yes I have put an email address into the Site Setting option "Email Addresses(es) For User Approval Notification".

I wonder if it is because I have upgraded the database from an old version of mojoPortal something hasn't been configured correctly.

To be precise I took a copy of my existing database from the old version, created a new folder and grabbed all the latest code using TortoiseHg and pointed the web.config (user.config) at the old database.  It appeared to apply all the necessary DB scripts when I hit the Setup page.

Cheers,

Chris

7/7/2011 8:47:55 AM
Gravatar
Total Posts 18439

Re: Smtp email not working for New Registration setting

Hi Chris,

Make sure the file exists /Setup/ProviderConfig/userregisteredhandlers/002_notifyadminsuserregisteredhandler.config

if it is missing that would explain it.

Otherwise if you have the source code and can step through it, you could set a breakpoint in/Secure/Register/aspx.cs line 348

and also in /Components/NotifyAdminUserRegisteredHandler.cs to see what is going on and verify if it is executing the code to send the email.

Hope that helps,

Joe

7/7/2011 7:06:04 PM
Gravatar
Total Posts 10

Re: Smtp email not working for New Registration setting

Hi Joe,

Thanks for your reply.

This file does exist /Setup/ProviderConfig/userregisteredhandlers/002_notifyadminsuserregisteredhandler.config

I've also tried setting breakpoints on the following lines, and also at the top of the RegisterUser_CreatingUser and RegisterUser_CreatedUser events but nothing fires at all.

/Secure/Register/aspx.cs line 348

/Components/NotifyAdminUserRegisteredHandler.cs

I will keep searching for answers but I am under the pump to get this feature working. :(

Cheers,

Chris

7/8/2011 9:12:26 AM
Gravatar
Total Posts 18439

Re: Smtp email not working for New Registration setting

Hi Chris,

Testing this on my local machine it works fine. I check the box in site settings to require approval before a new user can login, I add my address in the box for notification addresses, then I test in a different browser registering a new user and I get the email. I would make sure you've followed those steps and also that you have a valid Default From Address configured in site settings.

Best,

Joe

7/8/2011 9:52:18 PM
Gravatar
Total Posts 10

Re: Smtp email not working for New Registration setting

I've set up another blank database and created the latest mojoPortal database from scratch.  Configured the default site accordingly to send an email on registration but still no joy.

Is there something I should be looking for in the log file?  I have debug set to ALL in the config file but not seeing anything regarding trying to send emails.

I'm completely lost as to why this would not work, or at least attempt to work out of the box. :(

7/9/2011 6:29:07 AM
Gravatar
Total Posts 18439

Re: Smtp email not working for New Registration setting

Hi Chris,

Are you sure the contact form is still working?

Is it possible that you have set DisableTaskQueue to true in config? This particular email is sent from an EmailMessageTask that is queued on a background thread, so if the taskqueue was disabled it would not send anything.

Anything else about your environment that might be a factor? Running on a web farm or cluster or anything like that?

It works fine for me and I would think if there were a problem there would be more people reporting it.

In addition to the previous places I mentioned where you could set a break point, you could also set one in the Components/EmailMessageTask.cs

You mentioned before that you are using VS Express and had some difficulty stepping through the code. I generally recommend use VS 2010 Pro, you may qualify to get that free via the Microsoft Website Spark program.

Other than stepping through the code everything I know to tell about how to troubleshoot the problem is in the article Email Configuration.

Best,

Joe

7/22/2011 11:46:36 AM
Gravatar
Total Posts 9

Re: Smtp email not working for New Registration setting

Hi Joe -

I am experiencing the same exact issue.  I have attempted to do everything exactly as described above, including putting the breakpoints in the code.  I was not able to break the code at either of the locations you mentioned (I was able to put breakpoints in other areas of the site, and stop execution there).  As a test, I verified that the Contact page was working as expected.  There is nothing in the system log to indicate an issue.

Do you have any other suggestions?  I am getting ready to roll out a support site for my company and I'd like to have this feature in place so I can properly ensure that newly registered customers are linked to their internal customer accounts.

Thanks,

Andy

7/22/2011 12:03:58 PM
Gravatar
Total Posts 18439

Re: Smtp email not working for New Registration setting

I just tried it here again and it worked fine, it stopped at the breakpoints as well.

I suggest set your breakpoint in Register.aspx.cs at line 243 in the top of the RegisterUser_CreatedUser event, then step through and make sure it gets to the bottom where it fires the line of code

OnUserRegistered(u);

as long as that fires it should also break if you set a breakpoint on line 348 in OnUserRegistered

then it should loop through the available handlers firing each one and one of them will be the NotifyAdminUserRegisteredHandler, so it should then be possible to hit a breakpoint in that class as well.

It works perfectly here, I suggest make sure you have the latest code from the repository.

Hope that helps,

Joe

7/22/2011 1:45:31 PM
Gravatar
Total Posts 9

Re: Smtp email not working for New Registration setting

I thought I had the latest code; turns out I didn't.  I cleaned up the solution and it worked just fine now.  It's weird though because I when I went through Tortoise HG and did update, it said I had the latest version.  Thanks.

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