Advertisement
Guest User

Untitled

a guest
Apr 26th, 2015
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1.  
  2. $correo = $_POST["email"];
  3. $encabezado = $_POST["asunto"];
  4. $comentario = $_POST["cuerpo"];
  5.  
  6.  
  7. if(isset($_POST["enviar"])){
  8.  
  9. email_classic($correo, "oscar", $correo, "oscar", $encabezado, $comentario);
  10. }
  11.  
  12.  
  13.  
  14. // classic way
  15. function email_classic($from, $from_name, $to, $to_name, $subject, $message){
  16.  
  17. $from = $from_name. "<".$from.">\n";
  18.  
  19. $headers = "From: {$from}". "\n";
  20. $headers .= "Reply-To: {$from}". "\n";
  21. $headers .= "Cc: {$to}\n";
  22. $headers .= "Bcc: {$to}\n";
  23. $headers .= "X-Mailer: PHP/".phpversion()."\n";
  24. $headers .= "MIME-Version: 1.0". "\n";
  25. $headers .= "Content-Type: text/plain; charset=iso-8859-1";
  26.  
  27. $result = mail($to, $subject, $message, $headers);
  28.  
  29. echo $result ? 'Message sent!' : 'Mailer Error';
  30. }
  31.  
  32.  
  33.  
  34.  
  35.  
  36. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement