• 0
Sign in to follow this  
lordlex

Duvida com email

Question

ola amigos tudo beleza?

estou tentano pegar os emails cadastrados no bd e com um formulario enviar uma mensagem a todos q vem estao no bd, problema e q não esta enviano os emails =/

ta assim o codigo

<div id="conteudo">
<div id="boxplayer">
<h1>Bem vindo Admin</h1>


<div id="menu_pl">
<?php include "menu_admin.php"; ?>
</div><!-- menu player-->
</div>
<div id="boxplayerdr">
<h1>Enviar Email</h1>
<br />


<?php

include "conecta.php";

$pegamail= mysql_query("SELECT email FROM cadastrado ");
    while($lista = mysql_fetch_array($pegamail)){

$p_email = $lista['email'];



if(isset($_POST['enviar'])){
    
$formato = "\nContent-type: text/html; charset=utf-8";
    $email = "[email protected]";
    //$assunto = "Solicitação de suporte";
    $tdemail = $_POST['email'];
    $msg = $_POST['msg'];
    
    mail("$tdemail", "Noticias OE", $msg, "from:$email".$formato );    
    
}
    
}
?>
<form method="post" action="" style="margin:10px 90px;">
<input type="text" name="email" value="<?php echo $p_email; ?>" />
<span style=" font:16px Arial, Helvetica, sans-serif; color:#DFDBDC;">Mensagem</span><br />

<textarea cols=40 rows=10 name='msg' ></textarea><br />
<input type="submit" name="enviar" value="Enviar" />


</form>
</div><!-- fecha bemvindo -->

</div><!-- fecha conteudo -->

o que sera q esta haveno sera q não esta pegano os emails do bd ? vlw ajuda

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Coloca a function dentro do While assim a cada e-mail selecionando ele já manda o e-mail.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this