PDA

View Full Version : Send email in PHP with Gmail [GMAIL-PHP]


udara1986
06-19-2009, 09:28 AM
download attachment and extract files into folder named email inside your development folder(htdocs/mydevelopment).
then use following code to create your email messege,

require_once('../email/class.phpgmailer.php'); //path to the above folder
$mail = new PHPGMailer();
$mail->Username = '*****@gmail.com'; //SMTP username
$mail->Password = '*****'; //SMTP password
$mail->From = '[email protected]';
$mail->FromName = 'anyone';
$mail->Subject = 'php gmail';
$mail->AddAddress($email);
$mail->Body = 'this is simply great';
$mail->Send();

now you are done with it.

udara1986
06-19-2009, 09:29 AM
btw i forgot to mention this is my 1st post in elakiri....

udara1986
06-19-2009, 09:33 AM
////////////////////////////////////////////////////
// PHPMailer - PHP email class
//
// Class for sending email using either
// sendmail, PHP mail(), or SMTP. Methods are
// based upon the standard AspEmail(tm) classes.
//
// Copyright (C) 2001 - 2003 Brent R. Matzelle
//
// License: LGPL, see LICENSE
////////////////////////////////////////////////////

/**
* PHPMailer - PHP email transport class
* @package PHPMailer
* @author Brent R. Matzelle
* @copyright 2001 - 2003 Brent R. Matzelle
*/