Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function send_html($from, $email, $subject = "AUCUN", $message, $cc = "", $bcc ="", $priotity = "3") {
- $headers = "";
- $headers .= "MIME-Version: 1.0rn";
- $headers .= "Content-type: text/html; charset=iso-8859-1rn";
- if (strpos($from, "ourwebsite.com") != false || strpos($from, "rencontresportive.com") != "") {
- $headers .= "From: Ourwebsite.com <" . $from . ">rn";
- } else {
- $headers .= "From: " . $from . " <" . $from . ">rn";
- }
- $headers .= "X-Sender: <" . $from . ">rn";
- $headers .= "X-Priority: " . $priotity . "rn";
- $headers .= "X-Mailer: PHPrn";
- $headers .= "Return-Path: <admin@ourwebsite.com>rn";
- if ($cc != "") {
- $headers .= "cc:" . $cc . "rn";
- }
- if ($bcc != "") {
- $headers .= "bcc:" . $bcc . "rn";
- }
- if (mail($email, $subject, $message, $headers)) {
- return true;
- } else {
- return false;
- }
- }
- send_html(contact@ourwebsite.com, me@me.com, utf8_decode("the subject"), "<h1>test</h1>");
- ini_set('sendmail_from', $from);
- <?php
- error_reporting(E_ALL|E_STRICT);
- ini_set('display_errors', 1);
- echo 'I am : ' . `whoami`;
- $result = mail('myaddress@mydomain.com','Testing 1 2 3','This is a test.');
- echo '<hr>Result was: ' . ( $result === FALSE ? 'FALSE' : 'TRUE') . $result;
- echo '<hr>';
- echo phpinfo();
- sendmail_from = "no-reply@mydomain.net"
- sendmail_path = "/usr/sbin/sendmail -t -i"
- ; For Win32 only.
- ;sendmail_from = me@example.com
- ; For Unix only.
- sendmail_path = "/usr/sbin/sendmail -t -i -f "care@mydomain.com"
- ; For Win32 only.
- ;sendmail_from = me@example.com
- ; For Unix only.
- sendmail_path = /usr/sbin/sendmail -t -i -f care@mydomain.com
Add Comment
Please, Sign In to add comment