Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- use PHPMailer\PHPMailer;
- use PHPMailer\PHPMailer\SMTP;
- use PHPMailer\PHPMailer\OAuth;
- use PHPMailer\PHPMailer\Exception;
- require '../php/phpmailer/class/PHPMailer.php';
- require '../php/phpmailer/class/SMTP.php';
- require '../php/phpmailer/class/OAuth.php';
- require '../php/phpmailer/class/Exception.php';
- // Inicia a Classe PHPMailer
- $mailer = new PHPMailer\PHPMailer(true);
- try{
- // Recebe as Variáveis
- $formNome = $_POST["formNome"];
- $formSobrenome = $_POST["formSobrenome"];
- $formEmpresa = $_POST["formEmpresa"];
- $formTelefone = $_POST["formTelefone"];
- $formCelular = $_POST["formCelular"];
- $formEmail = $_POST["formEmail"];
- $formMensagem = $_POST["formMensagem"];
- // Define: Dados do Servidor & Tipo de Conexão
- $mailer->SMTPDebug = 2;
- $mailer->isSMTP();
- $mailer->SMTPAuth = true;
- $mailer->SMTPSecure = 'ssl';
- //$mailer->Host = 'smtp.uhserver.com';
- //$mailer->Host = 'smtp.flickamarketing.com.br';
- //$mailer->Host = 'smtp.gmail.com';
- $mailer->Host = 'smtp.gmail.com';
- $mailer->Port = 465; // Porta de Entrada/Saida SSL do GMAIL
- $mailer->Username = 'thiagodbonis@gmail.com';
- $mailer->Password = '***';
- // Define: O formato do E-mail
- $mailer->IsHTML(true);
- // Define: Remetende do E-mail
- $mailer->setFrom($formEmail, $formNome);
- // Define: Destinatário do E-mail
- $mailer->addAddress($mailer->Username, "FLICKA MARKETING");
- //$mailer->AddCC('email@seuemail.com.br', 'Eu'); - Email em Copia p/ outro Email
- $mailer->Subject = 'FORMULÁRIO FLICKA MARKETING';
- $mailer->Body = nl2br("<strong>Desenvolvido por: <font color='red'>Thiago De Bonis Carvalho Saad Saud</font></strong>\n" . "==================================================\n" ."<strong>NOME:</strong> " . $formNome . " " . $formSobrenome . "\n\n<strong>EMPRESA:</strong> " . $formEmpresa . "\n\n<strong>TELEFONE:</strong> " . $formTelefone . "\n\n<strong>CELULAR:</strong> " . $formCelular . "\n\n<strong>E-MAIL</strong>: " . $formEmail . "\n\n<strong>MENSAGEM:</strong> " . $formMensagem . "\n==================================================");
- // Enviar o E-mail & Exibirá uma mensagem de Resultado
- $mailer->Send();
- }catch (Exception $e){
- header("HTTP/1.0 404 Not Found");
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement