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: / 18
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 (14)

Subscribe to this comment's feed

Show/hide comments
 1 2 > 
Nice article!
For long time I looking for some email send from joomla. Very good explications and very detalied.

Realizare magazin online
Realizare magazin online , December 16, 2011
Works great
I was looking for a simple solution without having to edit all stuff, and my got.
After years of working with Joomla,
ITS IS SO SIMPLE AS THIS.
You desrve a big thumbs up for showing that all those long timeJoomla users like me are as dumb as can be.
It is so very simple.
Erik , November 19, 2011
Thanks!
Thanks you so much for this, my face was becoming flat from banging it against my keyboard trying to get sendmail to work. You are truly a star, and, like you, I can't believe I've never spotted that before.
Joe
Joe Miller , October 03, 2011
doesn't work - error message
I tried everything above, in addition to other forums, and this is the error message I get:

This e-mail address is being protected from spambots. You need JavaScript enabled to view it does not appear to be a valid email address
Could not get email address, or email address not valid.


How do I fix this? thank you in advance for your response - this is extremely frustrating.
Jessica , June 21, 2011
mail settings in joomla
Mailer : SMTP server
mailfrom : This e-mail address is being protected from spambots. You need JavaScript enabled to view it '> This e-mail address is being protected from spambots. You need JavaScript enabled to view it
from name : name of sender
sendmail path :/usr/sbin/sendmail
SMTP authentication :Yes
SMTP security : TLS
SMTP port : 495
SMTP Username : This e-mail address is being protected from spambots. You need JavaScript enabled to view it
SMTP password : ***********
SMTP Host : smtp.gmail.com
Nivrutti , March 23, 2011
doesnt work on joomla 1.6
tries both ways doesnt work on joomla 1.6

Admin edit: I Have not tried it yet in 1.6, but since I wrote this about a year ago, I am not surprised if things turn out to be different in this version. However, if these instructions don't work in 1.6, a similar procedure may work. There is really no reason for it not to. It may be a matter of a slightly different setup.
doesnt work on joomla 1.6 , January 11, 2011
thanks
thank you very much!!!
i have been looking for this all day . finally it works smilies/wink.gif
omer , November 08, 2010
Thanks!
I was dealing with mercury what made me very crabby...
sometimes I don't see the forest for the trees smilies/wink.gif

cheers!
Gerry , September 20, 2010
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
 1 2 > 

Write comment

You can add your comment here

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