by
john » Sun Jan 10, 2016 11:18 pm
Hi KK
How can we use this with the PHP mailer integration or is what I assumed down below correct?
First I downloaded the stopforumspam.php and then enabled it via kfunctions.
Then I tried to use the stop_spam tag as well as the manual method you mentioned to test a known spammer. It did not work, so I continued to read and noticed that it was posted it was standard in couch by using check_spam
So, This is what my k_success looks like, it submits just fine - I just do not know if it is actually doing it's job with checking the database as this method did not have a way to test it with a change of the line code.
Additionally, another popular method is a hidden field that asks for telephone number. If someone fills out the hidden field it is most likely a bot as a user wouldn't have been able to via browser. Can this be done with couch? Added along the other spam checks (required human question and check_spam)?
Hope you had a happy new year!
- Code: Select all
<cms:if k_success>
<cms:check_spam email=frm_email />
<cms:php>
require 'PHPMailer/PHPMailerAutoload.php';
$mail = new PHPMailer;
$mail->isSMTP(); // Set mailer to use SMTP
$mail->Host = ''; // Specify main and backup SMTP servers
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = ''; // SMTP username
$mail->Password = ''; // SMTP password
$mail-> SMTPSecure = 'false'; // Enable TLS encryption, `ssl` also accepted
$mail->Port = 587; // TCP port to connect to
$mail->addAddress('', ''); // Add a recipient
$mail->addReplyTo('<cms:show frm_email />', '<cms:show frm_name />');
$mail->WordWrap = 50; // Set word wrap to 50 characters
$mail->isHTML(true); // Set email format to HTML
$mail->From = '<cms:show frm_email />';
$mail->FromName = '<cms:show frm_name />';
$mail->Subject = '<cms:show frm_subject />';
$mail->Body = '<cms:show frm_message />';
if(!$mail->send()) {
echo 'Message could not be sent.';
echo 'Mailer Error: ' . $mail->ErrorInfo;
} else {
echo 'Message has been sent';
}
</cms:php>
</cms:if>