1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.5 No email received for password and registration

Discussion in 'Troubleshooting and Problems' started by Pavle123, Oct 23, 2015.

  1. Pavle123

    Pavle123 Active Member

    Hi,

    After switching to a SiteGround hosting, my users are unable to retrieve their password via the email.

    However when I send a normal email to that very same email used for password retrieval, it works.

    Any idea what is wrong?

    Thanks in advance.
     
  2. Mike

    Mike XenForo Developer Staff Member

    Are there any errors in the XF server error log in the control panel? If not, that would imply the email was handed off to the mail handler/server so XF isn't involved. The server's mail log would have further details. Your host will need to access that for you normally (as it requires root access).
     
  3. Pavle123

    Pavle123 Active Member

    Hi @Mike

    I see these errors :
    I also changed a email to gmail inside |Options|Email|Default Email Address
    instead of a @domain name, problem persists. Users can not retrieve passwords nor register, as there is no confirmation link/reset link or anything, email does not arrive.

    "...failed: Unable to send mail. - library/Zend/Mail/Transport/Sendmail.php:137"
    photo.jpg

    I see couple of these errors, but when I try to retrieve a password, I do not see anything in error logs.

    Any idea what might be the problem?
     
    Last edited: Oct 23, 2015
  4. Shane Greer

    Shane Greer Member

    @Pavle123 Im getting the exact same errors.

    Still haven't found a solution but the common denominator could be the change of server. My problems started when I changed server.

    By any chance did your hosting change from PHP 1.54 to PHP 1.56?

    As an aside my php send mail is working on a test programme but not in Xenforo. No one really knows the answer.
     
  5. Pavle123

    Pavle123 Active Member

    @Shane Greer I changed my hosting 2 days ago. I am on SiteGround, according to phpinfo its PHP Version 5.4.45

    Just checked, and my php error log says this (full with errors like these)
    [20-Oct-2015 17:17:03 CST6CDT] PHP Fatal error: require(): Failed opening required '/home/public_html/forums.domain.com/library/XenForo/Autoloader.php' (include_path='.:/usr/local/php54/pear') in /home/public_html/forums.domain.com/index.php on line 6

    Seams like a php conflict/error of some sort.
     
  6. Shane Greer

    Shane Greer Member

    Check if your now on PHP 1.56. I see a lot of folk around are having this problem recently.
     
  7. Pavle123

    Pavle123 Active Member

    @Shane Greer My current PHP Version is 5.4.45. Not sure if that makes sense or I am checking it the wrong way?
     
  8. Shane Greer

    Shane Greer Member

    LOL.. nope your right... I was wrong. Its PHP 5.4 and 5.6.

    I upgraded to 5.6 with the new server and its basically kicked me in the cherries... LOL
     
  9. Tracy Perry

    Tracy Perry Well-Known Member

    Are either one of you using SSL?

    If you are on a VPS/dedi, and are using the PHP mail function, what does your PHP log and MTA log show?
     
  10. Pavle123

    Pavle123 Active Member

    I am not on SSL. I am on shared.
     
  11. Tracy Perry

    Tracy Perry Well-Known Member

    Have you contacted your host to confirm that you can use the PHP sendmail option? Some hosts will not allow it and require all mail to process via SMTP connections.
    I don't deal much with shared hosting any longer, since a lot of the configuration controls are out of your hands and left up to the hosting provider.

    To check to see if it (php sendmail) is working, they give a sample PHP page you can try using - you will need to change the email address in it to reflect a valid email you can receive.
    Code:
    <?php
    function spamcheck($field)
    {
    //filter_var() sanitizes the e-mail address that is inserted
    // The FILTER_SANITIZE_EMAIL filter removes all forbidden e-mail characters from the inserted string $field=filter_var($field, FILTER_SANITIZE_EMAIL);
    
    //filter_var() validates the e-mail address that is inserted
    // The FILTER_VALIDATE_EMAIL filter validates the value of the text inserted as an e-mail address
    if(filter_var($field, FILTER_VALIDATE_EMAIL))
    {
    return TRUE;
    }
    else
    {
    return FALSE;
    }
    }
    
    if (isset($_REQUEST['email']))
    {//this is a simple check that makes sure the email field not empty
    
    //this is the check that uses the validation function to ensure the email address is valid
    $mailcheck = spamcheck($_REQUEST['email']);
    if ($mailcheck==FALSE)
    {
    echo "You have inserted incorrect email address or have left some of the fields empty";
    }
    else
    {//send email
    $email = $_REQUEST['email'] ;
    $subject = $_REQUEST['subject'] ;
    $message = $_REQUEST['message'] ;
    mail("test@siteground.com", "Subject: $subject",
    $message, "From: $email" );
    echo "Thank you for using our mail form! We will get in touch with you soon!";
    }
    }
    else
    {//if the "email" field is not filled out the form itself will be displayed.
    echo "<form method='post' action='contact.php'>
    Email: <input name='email' type='text' /><br />
    Subject: <input name='subject' type='text' /><br />
    Message:<br />
    <textarea name='message' rows='15' cols='40'>
    </textarea><br />
    <input type='submit' />
    </form>";
    }
    ?>
     
    Pavle123 likes this.
  12. Pavle123

    Pavle123 Active Member

    Great idea Tracy. I will test it out, I already created a ticket with my provider, so will let you guys know if I managed to sort it out.
    Edit:
    The email was received after using script Tracy suggested. I guess I should wait for provider to investigate the issue further.
     
  13. Shane Greer

    Shane Greer Member

    Yeah my php test mail worked fine also. Im on shared hosting too.
     
  14. Pavle123

    Pavle123 Active Member

    So here is what we did.

    1. We configured email to SMPT like this - Not sure if this is best way? Perhaps @Mike or @Brogan know if smpt is a way to go?

    email.jpg
    2. Our email was flagged as spam by http://spamrl.com/, that is why emails got bounced back. I requested them to white list it, and apparently it will work for 7 days, after that, not sure what happens.

    If anyone had a similar issue, please let me know how you solved it.
     

Share This Page