Contact form not working

8 replies · opened Sep 14, 2017

WwillskzSep 14, 2017

I'm having an issue with my website

http://datamatte.com.br/contato-e-suporte.html

The contact form is not working properly, I want to use Google Recaptcha as well.

The fisrt problem, I can press submit without the bot validation
I filled the $recaptcha secret

// Add this only if you use reCaptcha with your Contact Forms
$recaptcha_secret = 'code-given-by-google'; // Your reCaptcha Secret

and uncomented the folowing line of code on sendemail.php

			// Uncomment the following Lines of Code if you want to Force reCaptcha Validation

			if( !isset( $_POST['g-recaptcha-response'] ) ) {
				echo '{ "alert": "error", "message": "Preencha a verificação de segurança e tente novamente" }';
			die;
			}

and the Google Recaptcha code are present on my HTML

                                    
                
                                        
                                        
                
                                    

The second problem is the message itself

I want to use SMTP, i filled the codes with my SMTP info and when I press "send" or in this case "enviar" in portuguese, the 'wheel' keep spining and the message is not sent nor any kind of error/success message.

I placed my smtp information on the sendemail.php

// If you intend you use SMTP, add your SMTP Code after this Line
$mail->isSMTP();                                      // Set mailer to use SMTP
$mail->Host = 'smtpserver;';  // Specify main and backup SMTP servers
$mail->SMTPAuth = true;                               // Enable SMTP authentication
$mail->Username = 'emailinformatiion';                 // SMTP username
$mail->Password = 'password;                           // SMTP password
$mail->SMTPSecure = 'tls';                            // Enable TLS encryption, `ssl` also accepted
$mail->Port = 587;                                    // TCP port to connect to

and class.phpmailer.php

    /**
     * Which method to use to send mail.
     * Options: "mail", "sendmail", or "smtp".
     * @var string
     */
    public $Mailer = 'smtp';

also

    /**
     * SMTP hosts.
     * Either a single hostname or multiple semicolon-delimited hostnames.
     * You can also specify a different port
     * for each host by using this format: [hostname:port]
     * (e.g. "smtp1.example.com:25;smtp2.example.com").
     * You can also specify encryption type, for example:
     * (e.g. "tls://smtp1.example.com:587;ssl://smtp2.example.com:465").
     * Hosts will be tried in order.
     * @var string
     */
    public $Host = 'smtp.datamatte.com.br:587';
    /**
     * The default SMTP server port.
     * @var integer
     * @TODO Why is this needed when the SMTP class takes care of it?
     */
    public $Port = 587;
    /**
     * What kind of encryption to use on the SMTP connection.
     * Options: '', 'ssl' or 'tls'
     * @var string
     */
    public $SMTPSecure = 'tls';
    /**
     * SMTP username.
     * @var string
     */
    public $Username = 'email';

    /**
     * SMTP password.
     * @var string
     */
    public $Password = 'password';

Maybe I messed up with something trying to make it work

SSemicolon WebSTAFFSep 19, 2017

Hello,

Thanks for your Patience!

  1. Can you comment the following code again so that we could test your form:
if( !isset( $_POST['g-recaptcha-response'] ) ) {
	echo '{ "alert": "error", "message": "Preencha a verificação de segurança e tente novamente" }';
	die;
}
  1. Please don't change any PHPMailer Core Files. Make changes to the include/sendemail.php File only.

Thanks for your Patience.

Meanwhile, do let us know if we can help you with anything else or if you find any further issues with Canvas.

WwillskzSep 19, 2017

Ok I re-uploaded the original phpmailer core files provided and commented the requested lines of code on sendermail.php

// Uncomment the following Lines of Code if you want to Force reCaptcha Validation

//if( !isset( $_POST['g-recaptcha-response'] ) ) {
//	echo '{ "alert": "error", "message": "Preencha a verificação de segurança e tente novamente" }';
//die;
//}

the same problem is happening.
Waiting Instructions

WwillskzSep 22, 2017

Waiting a reply...

SSemicolon WebSTAFFSep 23, 2017

Hello,

Thanks for your Patience!

We have tested your Website and the error message we are getting is: SMTP connect() failed . We are suspecting an issue with the following line of code:

$mail->Host = 'smtpserver;';

but the correct code should be:

$mail->Host = 'smtp.datamatte.com.br';

Consider fixing this and try to submit the Form again. This should definitely fix the issue. Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

WwillskzSep 26, 2017

All code that I post was exemples, this line of code already contains the following code
$mail->Host = 'smtp.datamatte.com.br';

WwillskzSep 28, 2017

Don't you guys wanna the ftp info to look into the files and solve my problem?

WwillskzSep 29, 2017

Please, I Bought more time of support just to solve this particular problem, I really need help here!

SSemicolon WebSTAFFSep 30, 2017

Hello,

We Really Apologize about the Delays caused!

There are 2 possible solutions for your issue:

  1. Please make sure that your SMTP Ports are correctly configured according to what is defined in your Hosting Control Panel:
$mail->SMTPSecure = 'tls';
$mail->Port = 587;
  1. If this still does not work, then you will need to contact your Web Hosting Provider for this issue since the SMTP Servers does not appear to be working correctly.

Please check these out and let us know. Thanks for your Patience.

Meanwhile, do let us know if we can help you with anything else or if you find any further issues with Canvas.

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard