Testing contact form locally on Mac

3 replies · opened Oct 17, 2023

CCharlieH94Oct 17, 2023

Hello,

I'm currently developing a site localing and trying to check the contact form works as needed while doing so, but cannot work out how to receive the email with output.
I've searched online and installed XAMMP which allowed me to submit the form, however I did not receive an email. The articles I've found suggested use of the Test Mail Server Tool from Toolheap to check the actual form output, however this only works on windows.

Any help appreciated.

Kind regards,
Charlie H

SSemicolon WebSTAFFOct 19, 2023

Hello,

Thanks for your Patience!

XAMMP or Localhost Servers are only meant to run PHP/MySQL in a Local Environment, however, they do not have the capabilities to send Emails online using the Local PHP mail() Function. In order to send emails, we recommend using SMTP Servers. You can simply use your Gmail Account (you will need to setup an App Password) to send Emails through the Contact Forms. Simply add your SMTP codes in the include/form.php File following this Documentations: https://docs.semicolonweb.com/docs/forms/form-setup/#docs-section-php and you are good to go.

Do remember that you cannot use your Actual Gmail/Google Password for SMTP, but instead you will need to setup an App Password: https://support.google.com/accounts/answer/185833?hl=en . Simply use the following SMTP codes for the Gmail:

$mail->isSMTP();
$mail->SMTPDebug = 0;
$mail->Host = 'smtp.gmail.com';
$mail->Port = 587;
$mail->SMTPSecure = 'tls';
$mail->SMTPAuth = true;
$mail->Username = "your-username@gmail.com";
$mail->Password = "your-app-password";

This will definitely work fine. Hope this Helps!

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

CCharlieH94Oct 31, 2023

Hi,
Thanks for the response.
I've followed the instructions as above - once I click submit the form just loads indefinitely, and no email is received. Should this be working locally, or was the intention I implement the code above and continue to run with XAMMP?

Thanks

EDIT
I've implemented the code as advised, and run it locally with XAMMP and have now received the test emails - so to confirm, does this mean the form should work when hosted live now?

SSemicolon WebSTAFFOct 31, 2023

Hello,

These codes have been tested and works perfectly fine for us on the Localhost/XAMPP and Online Web Servers. Since your Form File: include/form.php is returning an Error, it is an indication that this is a Server Configuration issue.

Please consider adding the .customjs Class to the .form-widget DIV in the HTML Codes and then the following code at the very top of your include/form.php File just after the opening php tags:

error_reporting(E_ALL);

which should display all the possible errors. Please notify us about the Error Message you see, after going through the process above, so that we can provide you with further assistance on this. 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