Guest User

Untitled

a guest
Jun 21st, 2018
267
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. function send_html($from, $email, $subject = "AUCUN", $message, $cc = "", $bcc ="", $priotity = "3") {
  2. $headers = "";
  3. $headers .= "MIME-Version: 1.0rn";
  4. $headers .= "Content-type: text/html; charset=iso-8859-1rn";
  5.  
  6. if (strpos($from, "ourwebsite.com") != false || strpos($from, "rencontresportive.com") != "") {
  7. $headers .= "From: Ourwebsite.com <" . $from . ">rn";
  8. } else {
  9. $headers .= "From: " . $from . " <" . $from . ">rn";
  10. }
  11.  
  12. $headers .= "X-Sender: <" . $from . ">rn";
  13. $headers .= "X-Priority: " . $priotity . "rn";
  14. $headers .= "X-Mailer: PHPrn";
  15. $headers .= "Return-Path: <admin@ourwebsite.com>rn";
  16.  
  17. if ($cc != "") {
  18. $headers .= "cc:" . $cc . "rn";
  19. }
  20. if ($bcc != "") {
  21. $headers .= "bcc:" . $bcc . "rn";
  22. }
  23. if (mail($email, $subject, $message, $headers)) {
  24. return true;
  25. } else {
  26. return false;
  27. }
  28. }
  29.  
  30. send_html(contact@ourwebsite.com, me@me.com, utf8_decode("the subject"), "<h1>test</h1>");
  31.  
  32. ini_set('sendmail_from', $from);
  33.  
  34. <?php
  35. error_reporting(E_ALL|E_STRICT);
  36. ini_set('display_errors', 1);
  37. echo 'I am : ' . `whoami`;
  38. $result = mail('myaddress@mydomain.com','Testing 1 2 3','This is a test.');
  39. echo '<hr>Result was: ' . ( $result === FALSE ? 'FALSE' : 'TRUE') . $result;
  40. echo '<hr>';
  41. echo phpinfo();
  42.  
  43. sendmail_from = "no-reply@mydomain.net"
  44. sendmail_path = "/usr/sbin/sendmail -t -i"
  45.  
  46. ; For Win32 only.
  47. ;sendmail_from = me@example.com
  48.  
  49. ; For Unix only.
  50. sendmail_path = "/usr/sbin/sendmail -t -i -f "care@mydomain.com"
  51.  
  52. ; For Win32 only.
  53. ;sendmail_from = me@example.com
  54.  
  55. ; For Unix only.
  56. sendmail_path = /usr/sbin/sendmail -t -i -f care@mydomain.com
Add Comment
Please, Sign In to add comment