Problems, need help? Have a tip or advice? Post it here.
28 posts Page 3 of 3
Is there any chance something else on the page could be interfering with it? The page contains a load of other content.
Thanks though, it's good to know it's working - that gives me a place to start!
Thanks so much for your patience and help today.
Alex
I stripped it all down, put it back together piece by piece and it seems to work with hardcoded values now. Just got to work my way on to the variables now!
Thank you so much for the assistance today. Hopefully I won't need to bother you for help so much again - hope to get much better with couch as time goes on!
Alex
You are welcome, Alex :)
Glad the problem is finally solved.
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>   
Hi jeminc,
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

The cms:check_spam tag does nothing if the form is accessed by an admin. So you need to access it while not logged-in as admin (try using a different browser) to see how it works.

I'm sure your GMail would have plenty of spam mails. Extract some email addresses from those and use it with your form.

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?

Sure. Please see viewtopic.php?p=20884#p20884 for one such solution.

Hope it helps.
Ok that makes sense, I will try that.

Great link to another thread, I implemented the honeypot as well as tim's toomanyurls with messages. I will post my code once finished turning my contact form into a databound form so I can store contact submissions for clients.
Hey there. I am using the same code which PaoloE mentioned herehttps://www.couchcms.com/forum/viewtopic.php?f=4&t=8675#p16802. But when I try to send mail, I got "551 Sender address is not valid for your login" error. My hosting company said there is no problem on their side. What can I do to solve this problem?
Hi,
The code is valid as I am still using it.

Are you hosting at GoDaddy by any chance?
Because if it's the case, they don't allow SMTP credentials from Gmail, for security reasons,
so you will have to use their SMTP.

If not GD, ask your hosting provider if they allow using Gmail eMails as SMTP relay.
28 posts Page 3 of 3