IsSMTP(); $mail->CharSet = 'UTF-8'; $mail->SMTPDebug = 2; $mail->SMTPAuth = true; $mail->SMTPSecure = 'tls'; $mail->Host = "smtp.gmail.com"; $mail->Port = 587; // 465 or 587 $mail->Username = "nissanleaf17@gmail.com"; // Google email account $mail->Password = "parol123"; // Password to this account $mail->SetFrom("leaf@electrocars.ua"); $mail->isHTML(true); $mail->Subject = $this->subject; $mail->Body = $this->render($this->type, ['params' => $this->params]); $mail->AddAddress('kennen.md@gmail.com'); $mail->AddAddress('pmartweb1@gmail.com'); if(!$mail->Send()) { echo "Mailer Error: " . $mail->ErrorInfo; } else { echo "Message has been sent"; } } }