en google consigues interminables demos del uso de Gmail con PHPMAILER, claro se requiere PHP
Código PHP:
<?php
if(!defined('sugarEntry'))define('sugarEntry', true);
require_once("include/phpmailer/class.phpmailer.php");
$mailer = new PHPMailer();
$mailer->IsSMTP();
$mailer->SMTPAuth = true; // enable SMTP authentication
$mailer->SMTPSecure = "ssl";
$mailer->Host = 'smtp.gmail.com';
$mailer->Port = '465';
$mailer->SetLanguage('phpmailer.lang-it','include/phpmailer/language/');
$mailer->Username = '[email protected]'; // Change this to your gmail adress
$mailer->Password = 'password'; // Change this to your gmail password
$mailer->From = '[email protected]'; // This HAVE TO be your gmail adress
$mailer->FromName = 'Administrator'; // This is the from name in the email, you can put anything you like here
$mailer->Body = 'This is the main body of the email';
$mailer->Subject = 'This is the subject of the email';
//$mailer->AddAddress('[email protected]');
if(!$mailer->Send())
{
echo "Message was not sent<br/ >";
echo "Mailer Error: " . $mailer->ErrorInfo;
}
else
{
echo "Message has been sent";
}
?>