Jump to content
hardgamer

Enviar conteúdos automaticamente por email via PHP

Recommended Posts

hardgamer

Boas

Estou a tentar enviar conteúdos via PHP automaticamente para o email. O código que estou a utilizar funciona, embora o email chegue à caixa de correio sem qualquer tipo de conteúdo, ou seja, em branco.

Alguém pode dar uma ajudinha? :cheesygrin:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>




<div id="1">

Teste


</div>


<script>
$.post("demo.php", { data : $("div#1").html() }, function(result){
  /* handle results */
});
</script>

<?php

  $to = "EMAIL AQUI";
  $subject = "HTML Data";
  $message = $_POST["data"];
  $headers = "From: The Server <server@doe.com>" . "\r\n" .
             "Content-type: text/html" . "\r\n";

  mail($to, $subject, $message, $headers);

?>

Share this post


Link to post
Share on other sites
hardgamer

Desta forma também não funciona... aparece sem conteúdo

<script>
$.ajax("demo.php", { data : $("div#1").html() }, function(result){
  /* handle results */
});
</script>

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.