WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Old issue: Registration emails not sent (14 posts)

  1. SocialBlogsite
    Member
    Posted 2 years ago #

    I know, it's an old issue, but it's affecting my sites. Yes, siteS.
    I have one hosting and with two wp installations, one for the main domain and the other in the virtual domain (in a sub-directory of the main site)
    None of them work.

    They are different wp versions: 2.9.2 and 3.2.1
    Both use its own database.

    I called Godaddy but they say they tested the php with a php script they copied into my sites and the emails are sent fine.

    I tried everything I found in these forums.
    I tried different emails, all existing ones, no success.
    Spam folders, server logs, removed all my functions, changed theme…

    Finally, I added a redirect RIGHT before the $phpmailer->Send(); line in wp_mail() function, in includes/pluggable.php, sending the $headers variables as URL query, to a function in ANOTHER server I use to test and display/dump the post/get variables, like

    header ("Location: http://somesite/viewpost.php?" . $headers);

    …and it doesn't get redirected, so I assume the wp_mail() function is not even executed.

    Any idea?

  2. Brad Markle
    Member
    Posted 2 years ago #

    so I assume the wp_mail() function is not even executed.

    Have you tried adding code similar to the below to see if wp_mail is running?

    die("wp_mail function is running");

    If you place that code towards the end of the function, the function may actually be running, and instead may be failing somewhere in the middle (which may not execute your code at the end).

  3. Brad Markle
    Member
    Posted 2 years ago #

    Hi SocialBlogsite. I just wanted to touch base to find out if you were able to make any progress on this?

  4. Nikki Blight
    Member
    Posted 2 years ago #

    I've found that certain hosts just don't like the wp_mail() function. I usually get around it by installing the WP SMTP Mail plugin and sending through smtp.gmail.com with my gmail account.

  5. SocialBlogsite
    Member
    Posted 2 years ago #

    Is there any advice you can give me to tell my Godaddy THEY changed something in THEIR end that made my wp installations to stop sending emails?
    like a piece of PHP that definitely should work… or something.

    BOTH my installations, versions 2.9 and 3.2.1, stopped sending emails.

    Thanks.

  6. SocialBlogsite
    Member
    Posted 2 years ago #

    Anyone?
    I'm sorry Brad, I'd swear I replied your question.

    No, it didn't work with that die message. Where should it be? I can't find it in the whole source code of the returned page (users list)

    Is there any way to figure out who's preventing it to run?
    what if I rename the function and anywhere it is called from?
    I'd really like to get proofs Godaddy is blocking it somehow, because I can't find anything else. No logs register a thing about it (Godaddy logs only register client pages accessed)

  7. SocialBlogsite
    Member
    Posted 2 years ago #

    I found this lines in wp_mail() function

    // Plugin authors can override the potentially troublesome default
    $phpmailer->From     = apply_filters( 'wp_mail_from'     , $from_email );
    $phpmailer->FromName = apply_filters( 'wp_mail_from_name', $from_name  );

    What is that? I had SERIOUS issues with my plugin accounts (somebody manually put my plugin down, and then my username was cursed, and then lots of issues until when logged a new user I was notified about some files scheduled for deletion my original user couldn't see) Seemed like moderator vendetta.

    I wonder whether how plugin authors relate to a email function :S

    What if I manually replace some variable to a name? (to make sure it's not be empty)
    Of course, that if the test above doesn't mean my function is not running at all.

  8. SocialBlogsite
    Member
    Posted 2 years ago #

    Good news!
    I dove into wp_mail() function and after many tests Godaddy ADMITTED they replicated the issue and will open a ticket for it.

    Of course, I don't have proof of that and they could actually say they never said so tomorrow ¬¬, but at least I will know they will be rather covering it up than the problem being "my code" (not their hosting).

    Anyway, I'll keep you posted.

    In the while, let me tell you neither replacing all instances of "wordpress@" in the wp_mail() function in pluggable.php nor creating a new email account named wordpress@… in my hosting fixed the issue. I had to rely on an SMPTP plugin to make it work.

    The advised test die("wp_mail function is running") works anywhere in the function wp_mail EXCEPT after the exception catcher at the end of the function. Below I marked the point where it stops working. I don't know whether it's normal because I don't know very well how a php server serves the pages, and it could be just because the page is refreshing before I see the message, because there's a return before the die statement (anyway, that return is triggered by an exception in the phpmailer)

    // Send!
    	try {
    		$phpmailer->Send();
    
    	   //die here shows message in browser
    
    	} catch ( phpmailerException $e ) {
    		return false;
    	}
    		//die here won't show. 'users' (success?) page loaded
    
    	return true;
    }
    endif;

    After the message displayed by "die" the email is not sent anyway.

  9. Brad Markle
    Member
    Posted 2 years ago #

    Hi SocialBlogsite, I apologize for not getting back to you much sooner. I'm glad to see you're making some progress here.

    I can tell you that as a programmer, whenever you try to tell another department (or someone else) that they MUST have done something to break your code, they need to know very specific details in order to review further. Without key details, they can only assume that it was you that caused the problem.

    I also work for a hosting company, and when a user tells us that something we did broke their script, many times it isn't something we did. If it is something we did, we'd have many customers calling us at once all reporting the same issue. Maybe that is what happened with Godaddy?

    I just wanted to give you a little background there. It's always a good feeling (at least for me anyways) to be able to prove someone wrong and say "Ha! See, YOU broke my script! Now fix it!".

    You provided the following code:

    catch ( phpmailerException $e ) {
    		return false;
    	}
    		//die here won't show. 'users' (success?) page loaded
    
    	return true;

    Try putting the die code before the function returns, such as:

    catch ( phpmailerException $e ) {
    		die("DIE, we're in the catch for phpmailerException");
    		return false;
    	}
    	return true;

    Good luck with GoDaddy, and keep us updated!

  10. SocialBlogsite
    Member
    Posted 2 years ago #

    It's fixed!!
    Godaddy admitted the issue, so there must be MILLIONS (thousands?) of affected users who's website users must NOT be receiving the password by email.

    So if your emails are not being sent, you can uninstall smtp plugins or wasting your time on WordPress forums.

    Here's the solution to the issue of registration emails with password not being sent to new users

    Enjoy it!

  11. Brad Markle
    Member
    Posted 2 years ago #

    I just read your blog posting and the interesting part is:

    We unblocked the email address associated to the account that was having issues.

    That right there, I believe, is the red flag. It sounds like GoDaddy blocked something within your account that prevented you from sending email. They may not be able to give you the info, but you may want to find out why (or more specifically what) you were blocked in the first place so you can prevent it from happening again.

  12. SocialBlogsite
    Member
    Posted 2 years ago #

    You're right, I didn't pay attention to that, but in person I was told about the corrupt files. I just pasted the automated email. It was probably leftovers of an email template for another message.

    It could be they prefer to say that rather than admit there were corrupt files or…

    Do you think they prepared a whole dummy re-install process to coverup their email blocking behavior?

  13. Brad Markle
    Member
    Posted 2 years ago #

    It could be they prefer to say that rather than admit there were corrupt files or…

    Do you think they prepared a whole dummy re-install process to coverup their email blocking behavior?

    From my experience with hosting companies (I've worked with 2 different hosting companies), the Support Team is very busy. The have phone calls coming in, live chats, and emails to answer. We can't say for sure, but most likely the Support Team would not have time to do any dummy installs in order to test / cover their tracks.

  14. SocialBlogsite
    Member
    Posted 2 years ago #

    Our WP was hacked once, and there were no logs of the attack so, as others said, it was other users in the cloud trespassing user's directory limits.

    I think covering that is a very good reason to build a control panel to allow you re-install something, although in this case isn't like that.

    In this case, I just called them and they told me the accounts were blocked (again) by the same issue they notified me last year (same-day fixed then):

    Their algorithm detected the pharma (attempt to) spam in my comments being sent to MYSELF, as an admin, to approve the message.

    Nothing I can do with it. I DO want the notifications, and I want to see what comes in it. Even spam links.

    The re-install thing was for their Form-Emailer, it was there forever, because you have access to those scripts and could damage them, and it contains a "from" email address input field, that could be the one fixing php mail issues. The rep I spoke with today, told me they can't tell me whether that email address would have an effect on php behavior or spam detection algorithms. I'm writing to them now to get an answer from their tech department.

Topic Closed

This topic has been closed to new replies.

About this Topic