Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Bonk error when resending email confirmation

pwolfepwolfe New
edited December 2013 in Vanilla 2.0 - 2.8

Hi, I'm getting a "BONK" error message whenever I try to resend an email confirmation upon signing up. The initial email after signing up was never received either. Here is the debugged error on line 688 from the php file:


684: if (isset($old_from)) {
685: ini_set('sendmail_from', $old_from);
686: }
687: if(!$rt) {
688: throw new phpmailerException($this->Lang('instantiate'), self::STOP_CRITICAL);
689: }
690: return true;
691: }



  • Aaah, we're getting there... You saw the Debugged error which means that you saw the detail page. At the top of the detail page of the bonk error is the actual error. Copy / Paste that error in the Vanilla Forums search box and hit Enter. See if that gives you some results.

    There was an error rendering this rich post.

  • At the top it says:

    Fatal Error in PHPMailer.MailSend();

  • vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited December 2013

    @pwolfe Please find file in library/vendors/phpmailer/class.phpmailer.php, go to line 815 and comment out this line like I did below see if that fixes it :

    //throw new phpmailerException($this->Lang('authenticate'));

  • Thanks. That worked so the BONK error doesn't appear anymore, but the email was never delivered. It isn't in my junk folder either -- nor is it in another email address that I set up for another username either.

    Any suggestions or reasons why it isn't sending an email confirmation?

  • vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited December 2013

    you need to make sure your email settings are correct using port 25 , what are your settings ? set the password to Off or try first using the local server mail system

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    You can also try the contact plugin . You need to set the default email in the config.php then try sending yourself a mail.

  • ShadowdareShadowdare r_j MVP
    edited December 2013

    Welcome to the community!

    The code around line 688 in the /library/vendors/phpmailer/class.phpmailer.php file from Vanilla is:

        if(!$rt) {
          throw new phpmailerException($this->Lang('instantiate'), self::STOP_CRITICAL);

    The exception was thrown because $rt wasn't defined. There's also a call with $this->Lang('instantiate') which indicates that the exception gets thrown when the mail function could not be instantiated in the MailSend method.

    From looking at the code before where the exception gets thrown, it looks like $rt is supposed to be defined by calls to PHP's mail function; however, the calls to the mail function have the @ error control operator before them, which suppresses any errors that the mail function may return.

    Starting at line 645 where it says protected function MailSend($header, $body) { and down to the last closing brace, please look for lines that start with $rt = @mail( and replace them with $rt = mail(, and then when you resend an email confirmation from your website, you should be able to see the exceptions that the mail function is returning in order to determine what the real error is.

    On the other hand, one workaround you can do to get around this error is to set up an SMTP connection in the "Outgoing Email" settings page of Vanilla if your email provider provides SMTP info.

    Add Pages to Vanilla with the Basic Pages app

  • Thanks, I got it all sorted out. The emails are coming through now.

  • How did you fix the problem?

    Add Pages to Vanilla with the Basic Pages app

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    I know, now we are left in suspense ... we should remind people that if something we said helped fix it, they need to say what it was that fixed it. I bet it was what you said that fixed it, made sense to me more so than commenting functions out.

  • Oh sorry, it was my bad.

    I discovered I forgot to enter my email in the dashboard settings in the "outgoing mail" section settings. There wasn't anything wrong with the code or port settings etc.

Sign In or Register to comment.