Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
in Q2A Core by
You can write an example of the modified file qa-external/qa-external-emailer.php?
To send mail through Gmail. Sendmail on hosting does not work.

P.S. I do not know PHP

(Вы можете написать пример изменённого файла qa-external/qa-external-emailer.php?
Что бы отправлять почту через Gmail. Sendmail на хостинге не работает.
P.С. Я не знаю PHP )
related to an answer for: How do I configure mail?
Same here. Sendmail on hosting does not work.

1 Answer

+6 votes
Best answer

The Q2A install of PHPMailer seems to lack the necessary SMTP class (class.smtp.php) for sending via SMTP.

So, first fetch a version of PHPmailer 2 which provides it. I downloaded version 2.0.4 from here:


Unzip that, get the file, and put it  in /qa-external/.

Then copy in the example emailer, call it qa-external-emailer.php

You will need the qa_send_email() function to look something like this:

function qa_send_email($params)
  require_once QA_INCLUDE_DIR.'qa-class.phpmailer.php';
  require_once dirname(__FILE__) . '/class.smtp.php';
  $mailer=new PHPMailer();
  $mailer->IsSMTP(); // enable SMTP
  $mailer->SMTPAuth = true;
  $mail->SMTPSecure = 'ssl';
  $mailer->Host = "ssl://smtp.gmail.com:465";
  $mailer->Username = "<your gmail email address here>";
  $mailer->Password = "<your gmail password here >";
  $mailer->AddAddress($params['toemail'], $params['toname']);
  if ($params['html'])
  return $mailer->Send();
Put in your whole gmail email address and password above, and remember to set QA_EXTERNAL_EMAILER to true in qa-config.php.
i followed this but it still didn't work...
What sort of hosting provider are you using? Some hosting providers will not allow you the outgoing connection to talk to gmail.
I'm using bluehost. sendfeedback form works well except notification and pm.
Where can I find this example emailer?