Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $phone = $_POST['phone'];
- $name = $_POST['name'];
- require_once('phpmailer/PHPMailerAutoload.php');
- $mail = new PHPMailer;
- $mail->CharSet = 'utf-8';
- //$mail->SMTPDebug = 3; // Enable verbose debug output
- $mail->isSMTP(); // Set mailer to use SMTP
- $mail->Host = 'smtp.gmail.com'; // Specify main and backup SMTP servers
- $mail->SMTPAuth = true; // Enable SMTP authentication
- $mail->Username = 'blablalvalvedbveD@gmail.com'; // Наш логин
- $mail->Password = 'blablalvalvedbveD'; // Наш пароль от ящика
- $mail->SMTPSecure = 'ssl'; // Enable TLS encryption, `ssl` also accepted
- $mail->Port = 465;
- $mail->isHTML(true); // Set email format to HTML
- $mail->Subject = 'Новый заказ!';
- $mail->Body = '
- Пользователь оставил свои данные <br><br>
- Имя:'.$name.' <br>
- Телефон:'.$phone.'<br>';
- //$mail->AltBody = 'Это альтернативный текст';
- if(!$mail->send()) {
- header('Location: index.php');
- return false;
- } else {
- header('Location: index.php');
- return true;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement