You can't send outbound mails from localhost. To test the mail function, install mercury mail. It should come with xampp. Create emails for the localhost domains like steward@localhost. YOu could use aliases. Do your testing with that sending mails from one inbox to the other. You'd need a licensed version of mercury mail to send outbound messages.
Another option is to run your test on a remote server. Make sure the senders email is recognised by the sending server. Like you cannot be sending a gmail message using those settings you are displaying.
If sending from gmail is your objective, stackoverflow is full of answers already for how to send mails with gmail, even with codeigniter. Need some?
Here is what you ask for: Sending mail using gmail:
require_once "Mail.php";
$from = "<from.gmail.com>";
$to = "<to.yahoo.com>";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
$host = "ssl://smtp.gmail.com";
$port = "465";
$username = "myaccount@gmail.com"; //<> give errors
$password = "password";
$headers = array ('From' => $from,
'To' => $to,
'Subject' => $subject);
$smtp = Mail::factory('smtp',
array ('host' => $host,
'port' => $port,
'auth' => true,
'username' => $username,
'password' => $password));
$mail = $smtp->send($to, $headers, $body);
if (PEAR::isError($mail)) {
echo("<p>" . $mail->getMessage() . "</p>");
} else {
echo("<p>Message successfully sent!</p>");
}
?> <!-- end of php tag-->
Get info here: https://stackoverflow.com/a/2748837/827224
You could even do more if you are using codeigniter or any PHP email class like PHPMailer
search email classes in phpclasses.org. An example is:
http://www.phpclasses.org/blog/package/9/post/1-Sending-email-using-SMTP-servers-of-Gmail-Hotmail-or-Yahoo-with-PHP.html
Finally, here is a class you can use:
http://www.phpclasses.org/package/7834-PHP-Send-e-mail-messages-Gmail-users-via-SMTP.html