Home Conticreative Blogs The Conticreative Joomla Blog Joomla 1.5 - Sending System Emails from localhost

Blogs - The Conticreative Joomla Blog

Joomla 1.5 - Sending System Emails from localhost

Written by Marco Conti Thursday, 06 August 2009 12:30

Share |
User Rating: / 10
PoorBest 

Have you ever tried to use Joomla email features in a Localhost Installation? Here's how!

I often like to work on my Joomla web sites in my "localhost" server. On my Mac I use MAMP while on my PC I use XAMPP. Both are excellent PHP, Apache and MySql implementations that allow running a PHP based web script directly on a local computer. There are many advantages to doing that. Development is more immediate, response is faster and editing the files is more direct.

Banner

However, if you need to test any email related scripts, such as Newsletter components or any Joomla Component or plugin that sends emails as a result of user interaction you'll know that your localhost is not equipped to work as a mail server.

Both XAMPP and MAMP have options where you can set up a local mail server, but to say that the configuration is complex is an understatement. XAMPP comes with Mercury Mail and it took me hours to finally make it work. Only to have my computer crash on me and having to start from scratch.

The other day I was talking with one of my online students about some of the basic points of my Joomla-Dreamweaver integration method (for which I hope I'll have a book coming out soon) and specifically how to run a "localhost" based Joomla installation using the same files as the remote installation.

My student rightly pointed out that while the system works fine for much of the Joomla functionality, email is an issue.
Like me, she didn't want to waste time setting up a local mail server only for the sporadic Joomla based application.

At that point I had one of those "Eureka" moments. I went back to one of my local Joomla installations and I started messing around with Joomla's configuration settings.

You'll have noticed that in the "Server" tab of the Joomla Global Configuration there is a pane called "Mail Settings".
By and large, most people leave those setting to their default, which is "PHP Mail Function". However, there are 3 settings available altogether:

  1. PHP Mail Function (Built in PHP mail function)
  2. Sendmail (Uses the "Sendmail" program)
  3. SMTP Server (This uses the host server SMTP mail system)

Setting #3 actually uses an SMTP mail server in a way similar to a regular email program like MS Outlook or Mozilla Thunderbird.

I am not sure why I thought about SMTP Server only now, after years of working on Joomla in a localhost configuration, but I suspect many others are in the same situation. It's just one of those things that doesn't seem important until you need it.

So I went ahead and set up the SMTP Server option in my localhost built using one of my @conticreative.com email addresses. I entered the username and password, I entered the mailserver address (which in my case is mail.conticreative.com) and I tested the mail function using the "Mass Mail" feature built in Joomla.

IT WORKED!

I am not sure why I was so excited about it, after all, that's what it is supposed to do. But after assuming for so many years that it was impossible to test emails on a localhost installation of Joomla, it seemed like a momentous revelation.

In any event, now all my localhost installations are able to work with emails for testing purposes without having to become an expert on mail server administration.

I am sure that many others have figured this out a long time ago and yes, I am ashamed it took me so long to find this trick out, but better late than never, I guess.

If you have been struggling with the same issue (meaning you are as big an idiot as I am) here is a step by step list on how to set and test your localhost Joomla to use SMTP:

Click on teh Configuration tab
  1. Go to administration ==> Global Configuration
  2. Click on the "server" tab/link above the main pane
  3. On the lower right, find the "Mail Settings" area
  4. Select "SMTP Server"
  5. Now, you need to gather your email "Outgoing server" (usually it's either "mail.domain.com" or "smtp.domain.com")
  6. Global ConfigurationEnter your email username (on Cpanel server is "name+domain.com" or your email address with a "plus" (+) sign instead of the "at" (@) sign)
  7. Enter the port number if there is a field for it (Joomla 1.5.14 has a field for the port number but previous versions didn't) and you are done.
  8. Click on save and test your email using "Mass Mail" (admin menu ==> Tools ==> Mass Mail)

If you did everything right it should work just fine.

Here is what the "Mail Settings" interface looks like in Joomla 1.5.14:

mailserver on Joomla 1.5.14
Mail Settings admin form on Joomla 1.5.14

and this is what it looked like in previous versions (this is a screenshot from Joomla 1.5.10):

mailserver1.5.10
Mail Settings admin form on Joomla 1.5.10

As you can se, it's not very hard to set your localhost email in Joomla. I have not had a chance to test it in every possible situation, but Mass Mail works just fine as does a form I have been testing using Phil Taylor's "Joomla Forms".

I certainly hope you are not glazed over by now or bored to death for reading something that to you was a given. It wasn't for me and according to the many forum posts I read over the years in the Joomla forums there are many others in the same boat as I was.

Thank you for reading this post and I hope you found it useful.
Until next time - Marco

Do you have Joomla! or Web Development questions you would like us to answer in our 10 Minute Joomla! Tips Screencast or one of our our blogs?
Contact us or email This e-mail address is being protected from spambots. You need JavaScript enabled to view it

Trackback(0)

TrackBack URI for this entry

Comments (6)

Subscribe to this comment's feed

Show/hide comments
thank you
Saved me a lot of time, it's so easy to overlook the easy way, right?

cheche , July 25, 2010
Work great !!
After trying for 5 hours, I did found your great post. I am move to something else.

This e-mail address is being protected from spambots. You need JavaScript enabled to view it worked as well as name+domain.com, I am using cpanel.

Thanks

Naples website design , March 22, 2010 | url
joomla email setting for localhost smtp
Im puzzled. I have this same setup (xampp, mercury, joomla 1.5.14) and trying to test emails local and I get this error from joomla.SMTP Error! Could not connect to SMTP host.

I even dowloaded thunderbird, created test accounts, and verified that mercury was sending emails ok.

Mailer SMTP
Mail from test@localhost
From Name
Sendmail Path
SMTP Authentication No
SMTP Security None
SMTP Port 25
SMTP Username
SMTP Password
SMTP Host localhost

Ideas?
Bob , December 16, 2009 | url
addition from own experience
using xampp and joomla myself (1.5.14) I ran into the same problem. I solved it as follows:
In Global Configuration (joomla back-end) set
Mail Settings
Mailer SMTP
Mail from test@localhost
From Name
Sendmail Path
SMTP Authentication No
SMTP Security None
SMTP Port 25
SMTP Username
SMTP Password
SMTP Host localhost

In Mercury create a user named "test" no passwords.
Done.
It's that simple.
Stone Managed , November 17, 2009 | url
Yeah !!
It works !!!!! Thank you so much !!!
Emma , October 15, 2009 | url
Good tip!
I have been struggling to get my site mail working for months off and on. I am running 1.5.14 so I have this functionality you are describing, but it never occurred to me to use SMTP. I tried sendmail and PHP function but no luck.

Just a hint for others in my boat who use gmail: I followed the SMTP instructions for Outlook 2002 to get it to work. SSL encryption on port 465. The Outlook 2007 instructions are different (TLR different port) and did NOT work when I tried them.

Thanks for the brain-jog!
Steve Hess , October 14, 2009 | url

Write comment

smaller | bigger

busy

10 Minute Joomla! Tips Blog

Conticreative joomla book reviews

Independent joomla hosting reviews

Joomla Training

Conticreative offers Individual and Corporate training (in person or online) on Joomla, Wordpress, Zen Cart and other leading Open Source scripts.

[Read More...]

Books

Books we suggest...

 

Spreadfirefox Affiliate Button
switch the positions on