Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: Roozbeh on November 30, 2019, 03:12:02 PM

Title: Notifying admin when a new member joins - STOPPED WORKING
Post by: Roozbeh on November 30, 2019, 03:12:02 PM
Hi,

I have been using SMF for over 3 years and I have to say everything was more than satisfactory. I used smtp.gmail to send email to user and everything was working perfectly. All of a sudden couple of weeks ago I realized that SMTP stopped working (for some unknown reason) so switched to "PHP Setting". New users start receiving activation email again but I realized there was no notification email to me (as admin) to let me know that new member joined. before creating this topic I went through all the old topic and tried everything but unfortunately none worked. The fact that new users will be able to receive the activation email (during registration) and not me confuses me the most. would you please help me to understand what went wrong here?

FYI, I'm currently using version 2.0.15.

thank you in advance.

-Roozbeh
Title: Re: Notifying admin when a new member joins - STOPPED WORKING
Post by: m4z on November 30, 2019, 04:28:18 PM
Is the box under Admin > Members > Registration > Settings > "Notify administrators when a new member joins" ticked?
Title: Re: Notifying admin when a new member joins - STOPPED WORKING
Post by: Roozbeh on November 30, 2019, 04:41:02 PM
yes it was and it is. As I mentioned it was working for three years with no issue. I also checked my database the value under _setting -> notify_admin is set to 1 as well.
Title: Re: Notifying admin when a new member joins - STOPPED WORKING
Post by: Sir Osis of Liver on November 30, 2019, 04:41:56 PM
Do you receive any forum emails?
Title: Re: Notifying admin when a new member joins - STOPPED WORKING
Post by: Roozbeh on November 30, 2019, 04:51:02 PM
no nothing so far. Just to check, I did register myself using the same email provider (i.e. outlook) address to see whether I get any email and answer was yes. I could get activation email from forum but nothing as admin.
Title: Re: Notifying admin when a new member joins - STOPPED WORKING
Post by: Sir Osis of Liver on November 30, 2019, 04:58:18 PM
Try sending yourself an email with attached.  Edit file to include your webmaster address and mail to address (your admin account).
Title: Re: Notifying admin when a new member joins - STOPPED WORKING
Post by: Roozbeh on November 30, 2019, 05:23:41 PM
Yes I did use this script before and it works. I could send email to myself so issue is not my server either. I went a bit further and tried to debug the notifyadmin() function unfortunately not much success still could not figure out the issue.
Title: Re: Notifying admin when a new member joins - STOPPED WORKING
Post by: Sir Osis of Liver on November 30, 2019, 05:33:58 PM
Anything in forum or server error logs
Title: Re: Notifying admin when a new member joins - STOPPED WORKING
Post by: Roozbeh on November 30, 2019, 05:40:08 PM
No error message when using PHP default. Error messages appears when I switch back to smtp which is different story.
Title: Re: Notifying admin when a new member joins - STOPPED WORKING
Post by: Sir Osis of Liver on November 30, 2019, 05:51:10 PM
If testmail.php works, and members receive activation emails, forum is sending emails, so there's nothing wrong with your email setup.  If your admin email address receives test email, they're not being blocked as spam.  Is your webmaster address @gmail.com?
Title: Re: Notifying admin when a new member joins - STOPPED WORKING
Post by: Roozbeh on November 30, 2019, 05:56:56 PM
yes you are correct problem is not my email server. to answer your question I'm using @outlook.com.

one thing I did was to hard code the content of testmail.php into the notifyadmin() function but unfortunately could not make it work. SMF start crashing during member registration. I think I need to study more php before going this direction. 
Title: Re: Notifying admin when a new member joins - STOPPED WORKING
Post by: Sir Osis of Liver on November 30, 2019, 05:59:21 PM
Have you tried sending a newsletter to admins?
Title: Re: Notifying admin when a new member joins - STOPPED WORKING
Post by: Roozbeh on November 30, 2019, 06:01:17 PM
glad you asked, no I can not receive any newsletter either. very strange!!
Title: Re: Notifying admin when a new member joins - STOPPED WORKING
Post by: Sir Osis of Liver on November 30, 2019, 06:10:34 PM
If you have a test account with outlook email address that receives emails, make it admin and see if emails still work.
Title: Re: Notifying admin when a new member joins - STOPPED WORKING
Post by: Roozbeh on November 30, 2019, 06:23:57 PM
here we go, I added new account using one of my old email addresses ([email protected]) and it worked. I did send a newsletter to both admins but the only latest account received it.

would you please explain what went wrong? I really like to figure out the issue and somehow get involve into development if possible.
Title: Re: Notifying admin when a new member joins - STOPPED WORKING
Post by: Sir Osis of Liver on November 30, 2019, 06:26:11 PM
Change the email address in your original admin account, see if that fixes it.
Title: Re: Notifying admin when a new member joins - STOPPED WORKING
Post by: Illori on November 30, 2019, 06:31:20 PM
did you check your spam folder?
Title: Re: Notifying admin when a new member joins - STOPPED WORKING
Post by: Roozbeh on November 30, 2019, 06:36:42 PM
Quote from: Sir Osis of Liver on November 30, 2019, 06:26:11 PM
Change the email address in your original admin account, see if that fixes it.

I removed the test admin account and changed my email address to the one tested minutes ago and everything is working. thanks a lot for your help. but here is the question, if the issue was simply email address why did I receive email using testmail.ohp?
Title: Re: Notifying admin when a new member joins - STOPPED WORKING
Post by: Sir Osis of Liver on November 30, 2019, 06:43:43 PM
That's what I'm wondering.  The problem is obviously with the one email account, something to do with server settings or spam filters, but why do test emails get through? (https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.thekrashsite.com%2Fpics%2Fidk.gif&hash=9ac7acf13f4cfaa1b58390444a38dea11e5473d2)

Title: Re: Notifying admin when a new member joins - STOPPED WORKING
Post by: Roozbeh on November 30, 2019, 06:46:57 PM
If this help, the testmail email went directly to my spam folder but it went through as you mentioned..
Title: Re: Notifying admin when a new member joins - STOPPED WORKING
Post by: Sir Osis of Liver on November 30, 2019, 06:50:40 PM
Were there any other forum emails in spam folder?
Title: Re: Notifying admin when a new member joins - STOPPED WORKING
Post by: Roozbeh on November 30, 2019, 06:54:07 PM
No 🙂 Every time I miss any email, spam folder is the first place I check. no email came through during this issue.
Title: Re: Notifying admin when a new member joins - STOPPED WORKING
Post by: Sir Osis of Liver on November 30, 2019, 06:59:55 PM
Well, that makes no sense.  But there's nothing wrong with your forum, so that's the good news.
Title: Re: Notifying admin when a new member joins - STOPPED WORKING
Post by: m4z on November 30, 2019, 07:01:35 PM
What's your hosting situation, do you have access to your server's mail logs, f.e. via cpanel?
Title: Re: Notifying admin when a new member joins - STOPPED WORKING
Post by: Roozbeh on November 30, 2019, 07:05:57 PM
Quote from: Sir Osis of Liver on November 30, 2019, 06:59:55 PM
Well, that makes no sense.  But there's nothing wrong with your forum, so that's the good news.

thanks a lot for your help.

Not expert on SMF source code but last couple of days I started reading the SMF code and realized there are special treatments for hotmail email address when it comes to sendmail() function. is it possible that the some of these emails might not be correctly recognized as hotmail and mistreated?

again thanks for your help.
Title: Re: Notifying admin when a new member joins - STOPPED WORKING
Post by: Roozbeh on November 30, 2019, 07:10:09 PM
Quote from: m4z on November 30, 2019, 07:01:35 PM
What's your hosting situation, do you have access to your server's mail logs, f.e. via cpanel?

I'm using Godaddy. unfortunately don't know how to access it. still it does not make sense when testmail.php's email goes through but email from forum get stuck. it's does not seem to be server's problem as @Sir Osis of Liver mentioned.
Title: Re: Notifying admin when a new member joins - STOPPED WORKING
Post by: Illori on November 30, 2019, 07:26:40 PM
it is possible your email provider is killing off the email before it even gets to you. we have seen this before. you would need to slightly modify the email that SMF is sending and you will start to receive the emails.
Title: Re: Notifying admin when a new member joins - STOPPED WORKING
Post by: Roozbeh on November 30, 2019, 07:35:09 PM
Quote from: Illori on November 30, 2019, 07:26:40 PM
it is possible your email provider is killing off the email before it even gets to you. we have seen this before. you would need to slightly modify the email that SMF is sending and you will start to receive the emails.

what do you mean by "slightly modify the email that SMF is sending"? do you mean I change the content of default email sent by SMF?
Title: Re: Notifying admin when a new member joins - STOPPED WORKING
Post by: Aleksi "Lex" Kilpinen on December 01, 2019, 01:09:26 AM
Exactly, if the email is for some reason blocked due to contents, then changing the contents might work.
Title: Re: Notifying admin when a new member joins - STOPPED WORKING
Post by: Sir Osis of Liver on December 01, 2019, 10:01:56 PM
GoDaddy. :P
Title: Re: Notifying admin when a new member joins - STOPPED WORKING
Post by: Roozbeh on December 02, 2019, 01:44:56 PM
yes GoDaddy, however, with your help and GoDaddy's support page I managed to setup the SMTP format which fixed my initial issue of not receiving any email. now I can receive email but still when the new members login to the forum I won't be able to receive any notification. It seems like notifyadmin() function won't be able to access the list of admin email(s).
Title: Re: Notifying admin when a new member joins - STOPPED WORKING
Post by: Illori on December 02, 2019, 01:52:50 PM
I would suggest you to modify the email first and see if that helps. if not then we can look into other options.
Title: Re: Notifying admin when a new member joins - STOPPED WORKING
Post by: Roozbeh on December 02, 2019, 02:06:08 PM
good point, I'll do that and share the result. thanks!
Title: Re: Notifying admin when a new member joins - STOPPED WORKING
Post by: Roozbeh on December 03, 2019, 11:34:36 AM
Quote from: Illori on December 02, 2019, 01:52:50 PM
I would suggest you to modify the email first and see if that helps. if not then we can look into other options.

hi Illori you were right the email content was the reason for blocking the notification emails. I'm not sure if it's the link to new member profile or the wording itself. I guess I need to figure it out by trial and error. thank you again for your help.
Title: Re: Notifying admin when a new member joins - STOPPED WORKING
Post by: m4z on December 03, 2019, 11:37:04 AM
Please share your findings (and mark the topic as solved in the bottom left when the mystery is solved)!
Title: Re: Notifying admin when a new member joins - STOPPED WORKING
Post by: Roozbeh on December 03, 2019, 12:24:14 PM
after several trial and error, it turns out that any email with 'A new member has joined' as subject is being blocked by my domain host (i.e. GoDaddy). so in order to temporarily fix the issue, I modified all the subjects to ''New member has joined' in the 'Themes\default\languages\EmailTemplates.english.php' file. Now Everything is back to normal and I'll be able to receive notification email when new member joins.

thank you everyone for your help.