<?php

$to = "sylvie@tikiwiki.org";
$from = "sylvie@tikiwiki.org";
$crlf = "\n";
//$crlf = "\n\r"; on windows
$message = "Hello!";

///////////////////////////////////////////
$result = mail($to, 'Simple mail without header', $message);
echo "Simple mail without header sent (check you spam too). Result: ";var_dump($result);echo '<br>';

/////////////////////////////////////////////
$headers[0] = "MIME-Version: 1.0";
$headers[1] = "From: $from";
$headers[2] = "Return-Path: <$from>";
$headers[3] = "Reply-To: <$from>";
$headers[4] = 'Content-Type: text/plain; charset="utf-8"';
$headers[5] = "Content-Transfer-Encoding: 7bit";
//$headers[6] = "Message-ID:<...@...>";
$h = implode($headers, $crlf);
$result = mail($to,'Simple mail with headers',$message,$h);
echo "Simple mail with headers sent(check your spam too). Result: ";var_dump($result);echo '<br>';

//////////////////////////////////////
include_once('tiki-setup.php');
include_once ('lib/webmail/tikimaillib.php');

$mail = new TikiMail();
$mail->setSubject($subject.'Email tiki without modif');
$result = $mail->send(array($to));
echo "Tiki mail without modif sent. Result: ", var_dump($result);echo '<br>';

/////////////////////////////////////////
ini_set ("sendmail_from",$from);
$sender_email=$from;
$mail->setSubject($subject.'Email tiki with modif 1');
$mail->setText($message);
$mail->return_path = '';
$result = $mail->send(array($to));
echo "Tiki mail with modif 1 sent. Result: ", var_dump($result);echo '<br>';
////////////////////////////////////////

?>
