Mail sent / not sent messsage not shown

1 reply · opened Oct 25, 2019

VvbulashOct 25, 2019

Form on page looks exactly as:

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

        &lt;form class="row" id="zithr" action="include/form.php" method="post"&gt;

            &lt;div class="form-process"&gt;&lt;/div&gt;

            &lt;div class="col-md-6 form-group"&gt;
                &lt;label for="zithr-name"&gt;ФИО &lt;small&gt;*&lt;/small&gt;&lt;/label&gt;
                &lt;input type="text" id="zithr-name" name="zithr-name" value=""
                       class="form-control required"/&gt;
            &lt;/div&gt;

            &lt;div class="col-md-6 form-group"&gt;
                &lt;label for="zithr-email"&gt;Электронная почта &lt;small&gt;*&lt;/small&gt;&lt;/label&gt;
                &lt;input type="email" id="zithr-email" name="zithr-email" value=""
                       class="required email form-control"/&gt;
            &lt;/div&gt;

            &lt;div class="w-100"&gt;&lt;/div&gt;

            &lt;div class="col-12 form-group"&gt;
                &lt;label for="zithr-message"&gt;Сообщение &lt;small&gt;*&lt;/small&gt;&lt;/label&gt;
                &lt;textarea class="required form-control" id="zithr-message"
                          name="zithr-message" rows="6" cols="30"&gt;&lt;/textarea&gt;
            &lt;/div&gt;

            &lt;div class="col-12 hidden"&gt;
                &lt;input type="text" id="zithr-botcheck" name="zithr-botcheck" value=""
                       class="form-control"/&gt;
            &lt;/div&gt;

            &lt;div class="col-12"&gt;
                &lt;button class="button button-rounded button-large ls0 t400 m-0 nott" type="submit" id="zithr-submit"
                        name="zithr-submit" value="submit"&gt;Переслать
                &lt;/button&gt;
            &lt;/div&gt;

            &lt;!-- Form Settings --&gt;

            &lt;!-- Поля прямого письма - с сайта в адрес Анны Зайцевой --&gt;
            &lt;input type="hidden" name="prefix" value="zithr-"&gt;
            &lt;input type="hidden" name="subject" value="Сообщение с сайта курса для HR по IT-рекрутингу"&gt;
            &lt;input type="hidden" name="replyto" value="zithr-email"&gt;
            &lt;input type="hidden" name="html_title" value="Получено сообщение с сайта..."&gt;

            &lt;!-- Поля автоответа сервера на адрес посетителя сайта, указанный в форме обратной связи --&gt;
            &lt;input type="hidden" name="autoresponder" value="false"&gt;

        &lt;/form&gt;
    &lt;/div&gt;

include/form.php important parts of code are:

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

$fromemail = array(
'email' => 'info@bulash.ru', // Company's Email Address (preferably currently used Domain Name)
// 'email' => 'anna.recruting@gmail.com', // Company's Email Address (preferably currently used Domain Name)
'name' => 'Сайт курса для HR по IT-рекрутингу' // Company Name
);

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

$mail = new PHPMailer();

/* Add your SMTP Codes after this Line */

$Google = false;
$Yandex = true;
// If both are false - error message shown
// If one of them assigned to true - not shown success / error

if ($Google) {
$mail->isSMTP();
$mail->SMTPDebug = 2;
$mail->CharSet = 'UTF-8';

$mail-&gt;Host = "smtp.gmail.com";
$mail-&gt;Port = 465;
$mail-&gt;SMTPSecure = 'tls';
$mail-&gt;SMTPAuth = true;
$mail-&gt;Username = "anna.recruting@gmail.com";
$mail-&gt;Password = "***";

}
if ($Yandex) {
$mail->isSMTP();
$mail->SMTPDebug = 2;
$mail->CharSet = 'UTF-8';

$mail-&gt;Host = 'smtp.yandex.com';
$mail-&gt;Port = 587;
$mail-&gt;SMTPSecure = 'tls';
$mail-&gt;SMTPAuth = true;
$mail-&gt;Username = "info@bulash.ru";
$mail-&gt;Password = "***";

}

// End of SMTP

What's happened:

  • Both $Google and $Yandex set to false - shown red alert - can't instantiate PHPMailer. Sure.

  • $Google == true. Mail message sent finished with error (I see it by debug) but no error message shown. Spinner rotating indefinitely, form blocked. Why?

  • $Yandex == true. Mail message sent finished with no error (message received) but no success message shown. Spinner rotating indefinitely, form blocked. Why?

SSemicolon WebSTAFFOct 27, 2019

Hello,

Can you consider setting $mail->SMTPDebug = 0; and check what happens. If there are no errors, a Success Message should be displayed. Thanks for your Patience.

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