Advertisement
Guest User

Untitled

a guest
Dec 29th, 2016
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.08 KB | None | 0 0
  1. $name = $_POST['nome'];
  2. $zip = $_POST['cep'];
  3. $adress = $_POST ['endereco'];
  4. $number = $_POST['numero'];
  5. $comp = $_POST['complemento'];
  6. $neigh = $_POST['bairro'];
  7. $city = $_POST['cidade'];
  8. $state = $_POST['estado'];
  9. $iemail = $_POST['email'];
  10. $phone = $_POST['telefone'];
  11. $product = $_POST['produto'];
  12. $model = $_POST['modelo'];
  13. $brand = $_POST['marca'];
  14. $report = $_POST['laudo'];
  15. $date = $_POST['data'];
  16.  
  17. require 'phpmailer/PHPMailerAutoload.php';
  18.  
  19. $mail = new PHPMailer;
  20.  
  21. //$mail->SMTPDebug = 3; // Enable verbose debug output
  22.  
  23. $mail->isSMTP(); // Set mailer to use SMTP
  24. $mail->Host = 'smtp.meudominio.com'; // Specify main and backup SMTP servers
  25. $mail->SMTPAuth = true; // Enable SMTP authentication
  26. $mail->Username = 'contato@meudominio.com';// SMTP username
  27. $mail->Password = 'minhasenha'; // SMTP password
  28. $mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted
  29. $mail->Port = 587; // TCP port to connect to
  30.  
  31. $mail->setFrom('contato@meudominio.com', 'Contato');
  32. $mail->addAddress($iemail); // Add a recipient
  33. $mail->addReplyTo('contato@meudominio.com', 'Contato');
  34.  
  35. $mail->isHTML(true); // Set email format to HTML
  36.  
  37. $mail->Subject = 'Sua Ordem de Serviço Grupo SAB';
  38. $mail->Body = '
  39. <table id="recibo">
  40. <h1>Ordem de serviço</h1>
  41. <p>Cliente:'.$name'</p>
  42. <p>CEP:'.$zip'</p>
  43. <p>Endereço:'.$adress'</p>
  44. <p>Numero:'.$number'</p>
  45. <p>Complemento:'.$comp'</p>
  46. <p>Bairro:'.$neigh'</p>
  47. <p>Cidade:'.$city'</p>
  48. <p>Estado:'.$state'</p>
  49. <p>Produto:'.$produtc'</p>
  50. <p>Modelo:'.$model'</p>
  51. <p>Marca:'.$brand'</p>
  52. <p>Laudo:'.$report'</p>
  53. </table>';
  54. $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
  55.  
  56. if(!$mail->send()) {
  57. echo 'Message could not be sent.';
  58. echo 'Mailer Error: ' . $mail->ErrorInfo;
  59. } else {
  60. echo 'Message has been sent';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement