Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Acentuação
- $mail->Subject = utf8_decode($assunto);
- $mail->Body = utf8_decode($html);
- $html = '=?UTF-8?B?'.base64_encode($html).'?=';
- <?php
- //incluir o phpmailer
- require_once("phpMailer/PHPMailerAutoload.php");
- //criar instancia do phpmailer
- $mail = new PHPMailer();
- //Acentuação
- //$mail->Subject = utf8_decode($assunto);
- $mail->Body = utf8_decode($html);
- //$html = '=?UTF-8?B?'.base64_encode($html).'?=';
- // Mensagem formatada, enviada no corpo do email =================================================================================
- $html = "<!DOCTYPE html>
- <html>
- <head>
- <style>
- body {background:#FFFFFF;}
- a, a:link {color:#5b6105; text-decoration:none;}
- #tab {margin:0; padding:0px; width:500px; border:1px solid #8F8E96; padding:10px;}
- #tab tr {background:#F6F6F6; }
- #tab td {color:#000000; font: normal 20px arial, helvetica, sans-serif; border:dashed 1px #DDD; padding:30px;}
- </style>
- </head>
- <body>
- <br />
- <table border='0' cellspacing='10' cellpadding='0' id='tab' align='center'>
- <tr>
- <td>
- <b>Data:</b>{$_POST['Datas']}<br />
- <b>Módulo:</b>{$_POST['Modulo']}<br />
- <b>Assunto/Script:</b>{$_POST['AssuntoScript']}<br />
- <b>Descrição/Alteração:</b>{$_POST['DescricaoAlteracao']}<br />
- <b>Script/Informação:</b>{$_POST['ScriptInformacao']}<br />
- <b>Responsável:</b>{$_POST['Responsavel']}<br />
- <b>Tipo:</b>{$_POST['Tipo']}<br />
- <b>Origem:</b>{$_POST['Origem']}<br />
- </td>
- </tr>
- </table>
- <br />
- </body>
- </html>
- ";
- //criar variável do Anexo
- $arquivo = $_FILES['arquivo'];
- //habilitar SMTP
- $mail->isSMTP();
- $mail->SMTPOptions = array (
- 'ssl' => array(
- 'verify_peer'=> false,
- 'verify_peer_name' =>false,
- 'allow_self_signed' =>true
- )
- );
- //debug para informar os erros
- $mail->SMTPDebug=2; // 0-nada 1-msg cliente e servidor 3-tudo
- //Host
- $mail->Host = 'xxxxxxxxxxxxx';
- //tipo de proteção
- //$mail->SMTPSecure = "tls";
- //porta
- $mail-> Port = 25;
- //autenticação
- //$mail->SMTPAuth = true;
- //detalhes da conta de email
- //$mail->Username='xxxxx';
- //$mail->Password='xxxxx';
- //detalhes do email
- $mail->isHTML(true);
- $mail->setFrom ('xxxxxx@xxxxx.xxxx.br', 'xxxxxx');
- $mail->addAddress ('xxxxxxxxxxxxxxxx');
- $mail->Subject = 'Solicitação de Alterações';
- $mail->AddAttachment($arquivo['tmp_name'], $arquivo['name'] );
- $mail->Body = $html;
- //mensagem de envio ou erro
- if ($mail->send())
- echo "email enviado com sucesso";
- else echo "Deu ruim";
- ?>
- </html>
Add Comment
Please, Sign In to add comment