Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if($_POST){
- require 'email/PHPMailerAutoload.php';
- $mail = new PHPMailer;
- $nome = $_POST['nome'];
- $email = $_POST['email'];
- $telefone = $_POST['telefone'];
- $assunto = $_POST['assunto'];
- //$mail->SMTPDebug = 3; // Enable verbose debug output
- $mail->isSMTP(); // Set mailer to use SMTP
- $mail->Host = 'smtpi.uni5.net'; // Specify main and backup SMTP servers
- $mail->SMTPAuth = true; // Enable SMTP authentication
- $mail->Username = 'contato@iainet.com.br'; // SMTP username
- $mail->Password = 'xxxxxxx'; // SMTP password
- $mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted
- $mail->Port = 587; // TCP port to connect to
- $mail->setFrom('contato@iainet.com.br', 'iaiNet');
- $mail->addAddress('andre@iainet.com.br', 'Andre'); // Add a recipient
- $mail->addAddress('financeiro@asainovacao.com.br', 'Jackeline'); // Add a recipient
- $mail->addAddress('byte@iainet.com.br', 'Byte'); // Add a recipient
- $mail->addAddress('marcel@iainet.com.br', 'Marcel'); // Add a recipient
- $mail->addAddress('fabio@iainet.com.br', 'Fabio'); // Add a recipient
- $mail->addReplyTo('contato@iainet.com.br', 'iaiNet');
- // $mail->addCC('cc@example.com');
- // $mail->addBCC('bcc@example.com');
- // $mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments
- // $mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name
- $mail->isHTML(true); // Set email format to HTML
- $mail->Subject = '[iaiNet] Contato - site';
- $mail->Body = '<b>Nome</b>: '.$nome.' <br> <b>Email</b>: '.$email.' <br> <b>Telefone</b>: '.$telefone.' <br> <b>Assunto</b>: '.$assunto.' <br><br> Pagina: '.$_SERVER['HTTP_REFERER'].' <br><br> att,<br>iaiNet';
- $mail->AltBody = 'Nome: '.$nome.' | Email: '.$email.' | Telefone: '.$telefone.' | Assunto: '.$assunto.' | att, iaiNet';
- if(!$mail->send()) {
- echo 'Houve um erro ao enviar a mensagem';
- echo 'Mailer Error: ' . $mail->ErrorInfo;
- } else {
- // echo 'Message has been sent';
- header('Location: '.$_SERVER['HTTP_REFERER'].'?msg=sucesso');
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement