I don't know why I did not receive the mail although it echos "Your mail has been sent" ? Thanks.
<?php
session_start();
require_once "Mail.php";
require_once "Mail/mime.php";
$name = $POST['name'];
$phone = $POST['phone'];
$email = $POST['email'];
$contacttype = $POST['contacttype'];
$comments = $_POST['comments'];
$to = " ... my email ...";
$text = "text version";
$html = "<html><head>HTML version</head></html>";
$crln ="\n";
$hdrs = array ("From" => "$email", "Subject" => "Sending Mail from PHP");
$mime = new Mail_mime($crln);
$mime->setTxtBody($text);
$mime->setHTMLBody($html);
$body = $mime->get();
$hdrs = $mime->headers($hdrs);
$mail = Mail::factory('mail');
$mail->send($to, $hdrs, $body);
echo "Your mail has been sent.";
echo "<a href='main.php'>Return to Home Page</a>";
?>