Saturday, April 4, 2009

SMTP Gmail for Joomla

If you use joomla and your webhost does not give a support for sendmail or phpmailer function you just have achoice to use smtp. One of the hack to using smtp is use google/gmail account. Let’s do it.

You will have to locate the file that will be changed based on which version of Joomla! you have.

includes/phpmailer/class.phpmailer.php file in 1.0.x

libraries/phpmailer.php file in 1.5

on line 537 or close to it

The original code is:
if(strstr($hosts[$index], ":"))
list($host, $port) = explode(":", $hosts[$index]);
else
{
$host = $hosts[$index];
$port = $this->Port;
}
You must change this to:
if (preg_match('#(([a-z]+://)?[^:]+):(\d+)#i', $hosts[$index], $match))
{
$host = $match[1];
$port = $match[3];
}
else
{
$host = $hosts[$index];
$port = $this->Port;
}

And then go to your global configuration settings in your joomla administration panel.

change the smtp host to ssl://smtp.gmail.com:465

make sure all of your other mail settings are set and gmail might need to allow pop mail. (that can be changed in the gmail settings when you log in to your email.)
be sure to include your full email especially if you use your own domain with google aps.

example: email@domain.com or email@gmail.com

Type rest of the post here

Categories: , ,

0 komentar:

Copyright © Johannes Dwi Cahyo | Powered by Blogger

Design by Anders Noren | Blogger Theme by NewBloggerThemes.com | BTheme.net      Up ↑