This is somewhat good news,
PHP's internal mail() doesn't support authentication to the best of my knowledge (unless someone can correct me?)
You can download PHPMailer() and see the Basic SMTP Mail Example.
It will teach you how to use the PHPMailer Function, OR you can use swiftmailer, which I have heard is a little better but a little more complicated.
If you can read on their website on understand the docs, I would go with that, but below is a PHPMailer Example:
<?php
error_reporting(E_STRICT | E_ALL);
ini_set('error_reporting', E_ALL);
require_once('class.phpmailer.php');
$mail = new PHPMailer();
$body = "Hi,<br>\n<br>\nHow are you?";
$mail->IsSMTP(); // telling the class to use SMTP
$mail->Host = "mail.yourdomain.com"; // SMTP server
$mail->SMTPDebug = 2; // enables SMTP debug information (for testing)
// 1 = errors and messages
// 2 = messages only
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->Port = 587; // set the SMTP port for the server
$mail->Username = "smtpuser"; // SMTP account username
$mail->Password = "yourpassword"; // SMTP account password
$mail->SetFrom('shihao.ng@r-voz.com', 'Shihao Ng');
// Optional
//$mail->AddReplyTo("name@yourdomain.com","First Last");
$mail->Subject = "Hi!";
$mail->AltBody = strip_tags($body); // optional, comment out and test
$mail->MsgHTML($body);
// Who do you want to send to
$to = "shihao.ng@r-voz.com";
// Note: the name is OPTIONAL in the AddAddres (TO) field
$mail->AddAddress($to, "Shihao Ng");
// If you want to add an attachment
// $mail->AddAttachment("images/phpmailer.gif"); // attachment
if(!$mail->Send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
echo "Message sent!";
}
?>