A couple of weeks ago, I decided to use Gmail as SMTP server to send emails from my Joomla website. Here is explained what I did to make everything working.
First of all, I edited my configuration.php file to contain the following settings:
var $mailer = 'SMTP Server'; var $mailfrom = 'MY_GMAIL_ADDRESS'; var $smtpauth = '1'; var $smtpuser = 'MY_GMAIL_ADDRESS'; var $smtppass = 'MY_GMAIL_PASSWORD'; var $smtphost = 'ssl://smtp.gmail.com:465';
Then, I patched the libraries/phpmailer/phpmailer.php file by editing the SmtpConnect function. In the specific I changed the lines:
if(strstr($hosts[$index], ":"))
list($host, $port) = explode(":", $hosts[$index]);
into:
if (preg_match('#(([a-z]+://)?[^:]+):(\d+)#i', $hosts[$index], $match))
{
$host = $match[1];
$port = $match[3];
}
Please note that I’m using Joomla version 1.5.6. This trick is based on the following discussion.
Discussion
No comments yet.