Advertisement
Guest User

Untitled

a guest
Mar 21st, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. <?php
  2. // To send HTML mail, the Content-type header must be set
  3. $headers = [];
  4. $headers[] = 'MIME-Version: 1.0';
  5. $headers[] = 'Content-type: text/html; charset=iso-8859-1';
  6. $headers[] = 'From: Do Not Reply <noreply@example.com>';
  7.  
  8. $content = '
  9. <html>
  10. <head>
  11. <style>
  12. p {
  13. color: red;
  14. font-size: 18px;
  15. }
  16. </style>
  17. </head>
  18. <body>
  19. <p>This is test message.</p>
  20. </body>
  21. </html>
  22. ';
  23.  
  24. echo mail( 'johndoe@gmail.com', 'From Human', $content, implode("\r\n", $headers) ) . PHP_EOL;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement