SHARE
TWEET

stack-enviar-emails-com-acentos-corretos

a guest Apr 14th, 2016 13 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. session_start("admin");
  3. if($_SESSION["admin"] == "on"){
  4. include("../config.php");
  5. ?>
  6. <!DOCTYPE html>
  7. <html lang="pt-br">
  8. <head>
  9. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  10. <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=0" />
  11. <meta http-equiv="content-Language" content="pt-br">
  12. <title>Administração Newsletter - Barie Toner</title>
  13. <meta property="og:locale" content="pt_BR" />
  14. <link rel="shortcut icon" type="image/x-icon" href="ICON.png" />
  15. <link rel="stylesheet" href="css/style.css" type="text/css" media="all" />
  16. <link href='http://fonts.googleapis.com/css?family=Raleway:400,900,800,700,600,500,300,200,100' rel='stylesheet' type='text/css'>
  17. <script src="js/jquery-1.8.0.min.js" type="text/javascript"></script>
  18. <!--[if lt IE 9]>
  19. <script src="js/modernizr.custom.js"></script>
  20. <![endif]-->
  21. <script src="js/jquery.carouFredSel-5.5.0-packed.js" type="text/javascript"></script>
  22. <script src="js/functions.js" type="text/javascript"></script>
  23. <script src="js/show.js" type="text/javascript"></script>
  24. <script src="js/topbar.js" type="text/javascript"></script>
  25. </head>
  26. <body>
  27. <script type="text/javascript">
  28. var Tawk_API=Tawk_API||{}, Tawk_LoadStart=new Date();
  29. (function(){
  30. var s1=document.createElement("script"),s0=document.getElementsByTagName("script")[0];
  31. s1.async=true;
  32. s1.src='https://embed.tawk.to/56dee9c75ace28e73ac02ef7/default';
  33. s1.charset='UTF-8';
  34. s1.setAttribute('crossorigin','*');
  35. s0.parentNode.insertBefore(s1,s0);
  36. })();
  37. </script>
  38. <div id="wrapper">
  39. <div class="shell">
  40. <div class="container">
  41. <header id="header">
  42. <div class="mobile-hide"><h1 id="logo"><a href="#">Recarga de Toner e Cartuchos, Manutenção de Impressoras</a></h1></div>
  43. <div class="mobile"><div class="desktop-hide"><h1 class="logomobile"><a href="#">Recarga de Toner e Cartuchos, Manutenção de Impressoras</a></h1></div></div>
  44. <div class="search">Painel de Administração <br> <font style="color:red;"><a href="logout.php">Voltar</a></font></div>
  45. <div class="cl">&nbsp;</div></header>
  46. <nav id="navigation">
  47. <a href="#" class="nav-btn">Abrir Menu<span></span></a>
  48. <ul>
  49. <li class="active"><a href="index.php">Enviando Email</a></li>
  50. <li><a href="consultar.php">Consultar</a></li>
  51. <li><a href="add.php">Adicionar Email</a></li>
  52. <li><a href="incorporar.php">Incorporar Cadastro</a></li>
  53. <li><a href="comousar.php">Como Usar</a></li>
  54. <li><a href="upload-imagens.php">Upload Imagens</a></li>
  55. <li><a href="index.php">Voltar</a></li>
  56. </ul>
  57. <div class="cl">&nbsp;</div>
  58. <div class="main">
  59. <div class="featured2"><br>
  60. <section class="cols"><center>
  61. <?php              
  62.  
  63. $msg_para    = $_POST["msg_para"];
  64. $msg_assunto = $_POST["msg_assunto"];
  65. $msg_tipo    = $_POST["msg_tipo"];
  66. $mensagem    = $_POST["mensagem"];
  67. if($msg_para == "todos"){
  68. $sql = mysql_query("SELECT * FROM n_emails WHERE ativo = 's'");
  69. $total = mysql_num_rows($sql);
  70. $mailok = 0;
  71. $falha  = 0;
  72. while($lista = mysql_fetch_array($sql)){
  73. $email = $lista["email"];
  74. $cabecalho  = "From: $a_nome <$a_email>";
  75. $cabecalho .= "\nReply-To: $a_nome <$a_email>";
  76. $cabecalho .= "\nContent-Type: $msg_tipo";
  77.  if(@mail($email,$msg_assunto,$mensagem,$cabecalho)){
  78.  $mailok = $mailok + 1;
  79.  $msg = "<font color=green>SUCESSO!</font>";
  80.  }
  81.  else{
  82.  $falha = $falha + 1;
  83.  $msg = "<font color=red>FALHA!</font>";
  84.  }
  85.  ?>
  86.  <font face="Arial" size="2">Enviando para <b><?=$email?></b>...
  87.  <b><?=$msg?></b></font><br>
  88.  <?php } ?>
  89.  <script>alert("<?=$total?> e-mails deveriam ser enviados...\n<?=$mailok?> foram mandados corretamente,\n<?=$falha?> falharam!\n")</script>
  90.  <?php
  91. }
  92. else{
  93. $cabecalho  = "From: $a_nome <$a_email>";
  94. $cabecalho .= "\nReply-To: $a_nome <$a_email>";
  95. $cabecalho .= "\nContent-Type: $msg_tipo";
  96. if(@mail($msg_para,$msg_assunto,$mensagem,$cabecalho)){
  97.  $msg = "<font color=green>SUCESSO!</font>";
  98.  }
  99.  else{
  100.  $msg = "<font color=red>FALHA!</font>";
  101.  }
  102.  ?>
  103.  <font face="Arial" size="2">Enviando para <b><?=$msg_para?></b>...
  104.  <b><?=$msg?></b></font><br><?php
  105. }
  106. }
  107. else{
  108. echo "<script>location.href='login.php'</script>";
  109. }
  110. ?>
  111. </center></section></div>
  112. <div class="cl">&nbsp;</div>
  113. <div id="footer">
  114. <div class="footer-nav">
  115. <ul>
  116. <li class="active"><a href="home.html">Ínicio</a></li>
  117. <li><a href="sobre.html">Sobre</a></li>
  118. <li><a href="servicos.html">Serviços</a></li>
  119. <li><a href="logout.php">Sair da Conta</a></li>
  120. <li><a href="javascript:desinstalar()">Desinstalar</a></li></br>
  121. <li>diretoria | vendas | </a></li>
  122. </ul>
  123. <div class="cl">&nbsp;</div>
  124. </div>
  125. <p class="copy"><a href="skype:diretoria?chat"><img src="css/images/skype.png"></a><a href="javascript:abrir('https://tawk.to/c6fe2e15a65eee77616fd7836828c5b00f470407/popout/default/?$_tawk_popout=true&$_tawk_sk=56dd81082445fbd60e8104b7&$_tawk_tk=d9297f446fdd74f9eaf318bc1c43190e&v=458');"><img src="css/images/suporte.png"></a><a href="mailto:suporte"><img src="css/images/email.png"></a><a href="contato.html"><img src="css/images/telefone.png"></a>
  126. <div class="cl">&nbsp;</div>
  127. </div>
  128. </div>
  129. </div>
  130. </div>
  131. </div>
  132. </body>
  133. </html>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top