Send emails from the web


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <?php
  2. $email = "[email protected]";
  3.  
  4. /* Absender */
  5. $absender = "Testuser <".$email.">";
  6. /* Rueckantwort */
  7. $reply = $email;
  8. /* Betreff */
  9. $subject = "Kontaktformular";
  10.  
  11. /* Nachricht */
  12. $message = '
  13. <html>
  14. <head>
  15. <title>BlaBla</title>
  16. </head>
  17. <body bgcolor="#ff4500" link="#FFD700" vlink="#FFD700" alink="#ff7813">
  18. <table width="500" border="0" cellspacing="5" cellpadding="5">
  19. <tr>
  20. <td>
  21. <p>Inhalt der Email</p>
  22. </td>
  23. </tr>
  24. </table>
  25. </body>
  26. </html>
  27. ';
  28. /* Baut Header der Mail zusammen */
  29. $headers .= "From: $absender";
  30. $headers .= "Reply-To:$reply";
  31. $headers .= "X-Mailer: PHP/".phpversion()."";
  32. $headers .= "X-Sender-IP: $REMOTE_ADDR";
  33. $headers .= "Content-type: text/html";
  34.  
  35. /* Verschicken der Mail */
  36. if(mail($email, $subject, $message, $headers)) echo "<tr><td><p>Ihre Nachricht wurde erfolgreich verschickt.</p></td></tr>";
  37. ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.