UPDATE: Send Email With PHP and GMail Hosted for Your Domain

Due to the amount of requests emailed to me for working source code I have now posted the modified PHPMailer I use in my own projects. Click here to download the library. Here’s an example of how to use the code:

$mail = new PHPGMailer();
$mail->Username = '';
$mail->Password = 'password';
$mail->From = '';
$mail->FromName = 'User Name';
$mail->Subject = 'Subject';
$mail->Body = 'Hey buddy, here's an email!';

This will work for any GMail or Google Hosted email account. Just make sure to include the part for the username, even if it’s for standard GMail. Hope this saves people some hastle.

[tags]gmail, php, google, phpmailer[/tags]