1

My company wants to host a website on a CentOS server with a contact form and with a captcha and I stumbled upon PHPMailer. The code works on my localhost, but not on CentOS. I am getting a SMTP connect() failed error when I try to send a message to the email.

Also I notice when the captcha expires and when I click the checkbox again an error message was shown:

Cannot contact reCaptcha. Check your connection and try again.

Is it possible that it has a connection to the problem I'm having? I am still really new especially on CentOS. I've tried to google the problem, but I seem to cannot find a best solution for a fix.

Al Foиce ѫ
  • 4,195
  • 12
  • 39
  • 49
Junnel
  • 107
  • 1
  • 16

1 Answers1

1

PHPMailer has a debug setting so check this link: Debugging PHP Mail() and/or PHPMailerenter link description here + Check whether you're using SMTP (and SMTP Authentication) or just sendmail Maybe create a test script to use the simple php mail() function to run some tests to see if it's at PHP end or sendmail (exim or whatever mail server you have on the centOS box)

ReCapture is reset/cleared with the submission of your form so the first time you submit the form it will validate. The second submission it will not as it has either been cleared or changed by the first submission. If you refresh the page the reCapture will reload and you will be able to submit.

if you have 2 problems I would remove 1 of them and fix the one you're focusing on. Them move onto the second one. i.e. remove capture from your form and get the mail running. then add the capture component.

Hope that helps

Community
  • 1
  • 1
JI-Web
  • 481
  • 6
  • 27