Jump to content

Enviar conteúdos automaticamente por email via PHP


hardgamer

Recommended Posts

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);

?>

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.