form doesn't work

1 reply·opened Jun 23, 2023
E
esaulovarsenijJun 23, 2023

Hey, I have a problem with my form working. I'm using GoDaddy to host it (the PHP version is 7.4) and not really sure how to fix it. I have only js/functions.js connected to my HTML.

Here is what my contact section looks like:

            <section id="contact" class="contact section section-1-bg mb-0">

               <div class="contact-container container mw-lg">
                  <div class="contact-row row justify-content-between align-items-center">
                     <div class="contact-column col-lg-6">
                        <h5 class="ls-3 fw-normal text-black op-04 mb-2 text-uppercase">Get In Touch</h5>
                        <h3 class="mb-4 display-5 font-body fw-medium">Contact Us:</h3>
                        <p class="mw-xs lead op-07 mb-6">We are always here to assist you and answer all the question you may have. Get it touch about private AI instructions or working with your team to supercharge your business.</p>
                        <div class="row">
                           <div class="feature-box fbox-sm mb-4 col-sm-5 m-0">
                              <div class="fbox-icon">
                                 <i>
                                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
                                       viewBox="0 0 16 16">
                                       <path
                                          d="M0 4a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V4Zm2-1a1 1 0 0 0-1 1v.217l7 4.2 7-4.2V4a1 1 0 0 0-1-1H2Zm13 2.383-4.708 2.825L15 11.105V5.383Zm-.034 6.876-5.64-3.471L8 9.583l-1.326-.795-5.64 3.47A1 1 0 0 0 2 13h12a1 1 0 0 0 .966-.741ZM1 11.105l4.708-2.897L1 5.383v5.722Z" />
                                    </svg>
                                 </i>
                              </div>
                              <div class="fbox-content">
                                 <h4 class="text-transform-none font-body fw-normal mb-2"><a
                                       href="mailto:noreply@canvas.com" class="text-black">info@example.com</a>
                                 </h4>
                              </div>
                           </div>
                           <div class="feature-box fbox-sm mb-4 col-sm-5 m-0">
                              <div class="fbox-icon">
                                 <i>
                                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
                                       class="bi bi-telephone-outbound" viewBox="0 0 16 16">
                                       <path
                                          d="M3.654 1.328a.678.678 0 0 0-1.015-.063L1.605 2.3c-.483.484-.661 1.169-.45 1.77a17.568 17.568 0 0 0 4.168 6.608 17.569 17.569 0 0 0 6.608 4.168c.601.211 1.286.033 1.77-.45l1.034-1.034a.678.678 0 0 0-.063-1.015l-2.307-1.794a.678.678 0 0 0-.58-.122l-2.19.547a1.745 1.745 0 0 1-1.657-.459L5.482 8.062a1.745 1.745 0 0 1-.46-1.657l.548-2.19a.678.678 0 0 0-.122-.58L3.654 1.328zM1.884.511a1.745 1.745 0 0 1 2.612.163L6.29 2.98c.329.423.445.974.315 1.494l-.547 2.19a.678.678 0 0 0 .178.643l2.457 2.457a.678.678 0 0 0 .644.178l2.189-.547a1.745 1.745 0 0 1 1.494.315l2.306 1.794c.829.645.905 1.87.163 2.611l-1.034 1.034c-.74.74-1.846 1.065-2.877.702a18.634 18.634 0 0 1-7.01-4.42 18.634 18.634 0 0 1-4.42-7.009c-.362-1.03-.037-2.137.703-2.877L1.885.511zM11 .5a.5.5 0 0 1 .5-.5h4a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-1 0V1.707l-4.146 4.147a.5.5 0 0 1-.708-.708L14.293 1H11.5a.5.5 0 0 1-.5-.5z" />
                                    </svg>
                                 </i>
                              </div>
                              <div class="fbox-content">
                                 <h4 class="text-transform-none font-body fw-normal mb-2"><a href="tel:+122-55412474"
                                       class="text-black">(1) 22
                                       55412474</a></h4>
                              </div>
                           </div>
                           <div class="feature-box fbox-sm mb-4 col-sm-12 m-0">
                              <div class="fbox-icon">
                                 <i>
                                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
                                       viewBox="0 0 16 16">
                                       <path
                                          d="M12.166 8.94c-.524 1.062-1.234 2.12-1.96 3.07A31.493 31.493 0 0 1 8 14.58a31.481 31.481 0 0 1-2.206-2.57c-.726-.95-1.436-2.008-1.96-3.07C3.304 7.867 3 6.862 3 6a5 5 0 0 1 10 0c0 .862-.305 1.867-.834 2.94zM8 16s6-5.686 6-10A6 6 0 0 0 2 6c0 4.314 6 10 6 10z" />
                                       <path d="M8 8a2 2 0 1 1 0-4 2 2 0 0 1 0 4zm0 1a3 3 0 1 0 0-6 3 3 0 0 0 0 6z" />
                                    </svg>
                                 </i>
                              </div>
                              <div class="fbox-content">
                                 <h4 class="text-transform-none font-body fw-normal mb-2">
                                    795 Folsom Ave, Suite 600
                                    San Francisco, CA 94107
                                 </h4>
                              </div>
                           </div>
                        </div>
                     </div>
                     <div class="contact-column col-lg-5 mt-5 mt-lg-0">
                        <div class="contact-form-wrapper card border-0 p-4">
                           <div class="contact-form-body card-body p-0">
                              <div class="contact-form form-widget">

                                 <div class="form-result"></div>

                                 <form class="mb-0" id="template-contactform" name="template-contactform"
                                    action="include/form.php" method="post">

                                    <div class="form-process">
                                    </div>

                                    <div class="row">
                                       <div class="col-12 form-group mt-3 mb-4">
                                          <label class="color" for="template-contactform-name">Name
                                             <small>*</small></label>
                                          <input type="text" id="template-contactform-name"
                                             name="template-contactform-name" value="" class="form-control required">
                                       </div>

                                       <div class="col-12 form-group mb-4">
                                          <label class="color"
                                             for="template-contactform-email">Email <small>*</small></label>
                                          <input type="email" id="template-contactform-email"
                                             name="template-contactform-email" value=""
                                             class="required email form-control">
                                       </div>

                                       <div class="col-12 form-group mb-4">
                                          <label class="color" for="template-contactform-message">Message
                                             <small>*</small></label>
                                          <textarea class="required form-control" id="template-contactform-message"
                                             name="template-contactform-message" rows="4" cols="30"></textarea>
                                       </div>

                                       <div class="col-12 form-group mb-4 d-none">
                                          <input type="text" id="template-contactform-botcheck"
                                             name="template-contactform-botcheck" value="" class="form-control">
                                       </div>

                                       <div class="col-12 form-group mb-0">
                                          <button class="btn text-white py-3 w-100 bg-color" type="submit"
                                             id="template-contactform-submit" name="template-contactform-submit"
                                             value="submit">Send
                                             Message</button>
                                       </div>
                                    </div>

                                    <input type="hidden" name="prefix" value="template-contactform-">

                                 </form>
                              </div>
                           </div>
                        </div>
                     </div>
                  </div>
               </div>

            </section>

Here is my form.php file beginning, where I did a change:

<?php

use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;

require 'phpmailer/src/Exception.php';
require 'phpmailer/src/PHPMailer.php';
require 'phpmailer/src/SMTP.php';

/*-------------------------------------------------
	Receiver's Email
---------------------------------------------------*/

$toemails = array();

$toemails[] = array(
	'email' => 'myemail@gmail.com', // Your Email Address
	'name' => 'Test' // Your Name
);

/*-------------------------------------------------
	Sender's Email
---------------------------------------------------*/

$fromemail = array(
	'email' => 'myemail@gmail.com', // Company's Email Address (preferably currently used Domain Name)
	'name' => 'Test' // Company Name
);

/*-------------------------------------------------
	reCaptcha
---------------------------------------------------*/

// Add this only if you use reCaptcha with your Contact Forms
$recaptcha_secret = ''; // Your reCaptcha Secret

/*-------------------------------------------------
	hCaptcha
---------------------------------------------------*/

// Add this only if you use hCaptcha with your Contact Forms
$hcaptcha_secret = ''; // Your hCaptcha Secret

/*-------------------------------------------------
	PHPMailer Initialization
---------------------------------------------------*/

$mail = new PHPMailer();

/* Add your SMTP Codes after this Line */

// End of SMTP

Please help

S
SemiColonWebSTAFFJun 26, 2023

Hello,

Thanks for your Kind Patience!

We recommend using SMTP: https://docs.semicolonweb.com/docs/forms/form-setup/#docs-section-php as GoDaddy Hosting blocks PHP mail() Function (which other Hosting Providers will also Block due to security concerns, so it is always recommended to use SMTP). Additionally, it is better if you use SMTP from a dedicated SMTP Service like SendGrid or Gmail (using an App Password) as GoDaddy Hosting are known for blocking SMTP on their own Servers.

Hope this Helps!

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

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