How to configure mail facility on joomla website

I have read quite a number of posts on this site regarding use of PHP Mail function,sendmail and so on but all configurations i have tried seem to be failing me.Here is the configuration;

Mailer: PHP Mail Function
Mail from:
From Name: myname
Sendmail Path: /usr/sbin/sendmail
SMTP Authentication: Yes
SMTP Username:
SMTP Password: mypassword
SMTP Host:
I have also tried the other options;Sendmail and SMTP Server and in all of them,i dont experience error messages.
I run this webserver on Redhat Linux Enterprise AS.The version of joomla is 1.5.10.
I have installed kunena forum and i want users to be able to recieve emails once they register on the site.I also want people who come to the site and want to use the contact us form to also recieve emails once they have filled in the form.
With the above configurations,i dont see any error messages when i  try to fill in the contact us form.The message saying Thank you for the e-mail comes up but no mail is being sent to both my yahoo account am using to test aswell as to myself copy.
Can anyone who understands this please take me through the configurations to make this work.
Many thanks,
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dave BaldwinFixer of ProblemsCommented:
The simple PHP "mail()" function doesn't do authentication with username and password.  It also doesn't easily do HTML email.  There are a number of more sophisticated email libraries and packages for PHP but I haven't used any of them enough to recommend one.

In addition, sending email from a website without a regular email account to support it can be trouble.  Some services like Yahoo, Hotmail, and Gmail will check to see if there is a known email account record before accepting the email from you.  Those services are maybe more interested in preventing spam than delivering email.
protechzmAuthor Commented:
Hi Dave,
I understand your explanation.Maybe its the way i have explained,what i really want is a way of sending confirmation link to any user that has subscribed to the forum through the email they have provided.I also would like to have the  system send alerts to those subscribed to the thread automatically when a response has been posted.I dont know how this works becuase am not a php guru neither do i know any html or any programming that would be required to achieve this.There will also be times when i will have to send mass mail to all the members.
I hope am making sense.
Dave BaldwinFixer of ProblemsCommented:
Mass or bulk email is best done thru services like Constant Contact, iContact, and Aweber.  You'd think email would be an easy thing by now but it's not because of the spam problem.  Those services specialize in doing the things it takes to get email newsletters to go thru.

You will need an email account associated with your website even if you use one of the services.  A Yahoo email account is probably not good enough.  Does your hosting provide email accounts with the hosting account?  That would be best for this purpose.

Does the "kunena forum" include a page for doing emails or are you trying to write your own?
Powerful Yet Easy-to-Use Network Monitoring

Identify excessive bandwidth utilization or unexpected application traffic with SolarWinds Bandwidth Analyzer Pack.

Try a component called acymailing for sending mass newsletters within Joomla itself.

While I don't want to sound like I am undermining DaveBaldwin, the services mentioned I believe you will need to pay a subscription to use. It will come down to what you want to use it for. I personally find a component within Joomla easier to manage as it sends direct to your user list.

This isn't quite what your problem is but it might help when you solve why you can't email.

I use Joomla a lot and have never ever had any problems with emailing directly from the base install of Joomla. Its just something that's always worked for me.

One thing you might want to try is turning off SMTP authentication... while it sounds like something you need... it actually isnt.

Your SMTP host should just remain localhost unless of course the mail and web server are different.... mine are always the same... but I think this doesn't count if Authentication is off anyway.

Sendmail Path is correct as is the other settings you have from the look of things.
Dave BaldwinFixer of ProblemsCommented:
I know a lot of people want to send out their own mass emails.  I recommend the services because the people who are not programmers often find that it is more difficult than they imagined.  If you send too many mass emails, you can be blacklisted.  If you're sending HTML emails, the different email clients will mangle what you send so you might not recognize it.

If you're not sending too many and they are plain text, you will probably be fine.  Anything more and you can start to have problems.  I have Gmail, Hotmail, and Yahoo accounts to check emails along with every client I can find like Outlook Express, Outlook 2000, Thunderbird, Apple Mail and Sea Monkey.  Even had Eudora running but it's hopeless on HTML email.  And Exim on Linux if I need it.
Dave BaldwinFixer of ProblemsCommented:
That said, here is my standard email demo.  Save it as 'Email.php'.  Put your own info in the '$toText' and it should send email to you.  If your server supports it.  Standard PHP 'mail()' function.  Been tested/used on Windows and Linux web servers.
# some settings of POST vars
if (!isset($_POST['send']))  $send = ''; else $send = $_POST['send'];
if (!isset($_POST['toText'])) $toText = ''; else $toText = $_POST['toText'];
if (!isset($_POST['ccText'])) $ccText = ''; else $ccText = $_POST['ccText'];
if (!isset($_POST['subjectText'])) $subjectText = ''; else $subjectText = $_POST['subjectText'];
if (!isset($_POST['msgText'])) $msgText = ''; else $msgText = $_POST['msgText'];
if (!isset($_POST['ccText'])) $ccTexth = ''; else $ccText = $_POST['ccText'];
if (!isset($_POST['bccText'])) $bccText = ''; else $bccText = $_POST['bccText'];
if (!isset($_POST['nameText'])) $nameText = ''; else $nameText = $_POST['nameText'];
if (!isset($_POST['fromText'])) $fromText = ''; else $fromText = $_POST['fromText'];

if ($send == "") {
    $title="Test Email Page";
else {
	if($fromText === "") die("No name!");
	$title="Test Email Page";
  $announce="Your Message has been Sent!";
	$header = "From: ".$fromText."\r\n";
//	$header .= "Cc: ".$ccText."\n";
	$header .= "Reply-To : ".$fromText."\r\n";
	$header .= "Return-Path : ".$fromText."\r\n";
	$header .= "X-Mailer: PHP\r\n";
	$header .= "MIME-Version: 1.0\r\n";
	$header .= "Content-Type: text/plain; charset=iso-8859-1\r\n";
//	ini_set(sendmail_from,$fromText);  
	mail($toText, $subjectText, $msgText, $header, '-f'.$fromText);
//	ini_restore(sendmail_from);

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title><?php echo($title)?></title>
<style type="text/css">
A:link { color: #999999; }
A:visited { color: #999999; }
A:hover {color: #0099ff;}
<script type="text/javascript">
function check()
var at=document.getElementById("fromText").value.indexOf("@");
var eml=document.getElementById("fromText").value;
var nam=document.getElementById("nameText").value;
var alerttxt="";
var submitOK="true";

if (eml.length < 5 || at == -1)
    alerttxt=alerttxt+"Please enter a valid e-mail address!\r\n";
    //return false;
if (nam.length < 5)
    alerttxt=alerttxt+"Please enter your name.\r\n";
    //return false;
if (nam != "aaron")
    alerttxt=alerttxt+"Please enter your name.\r\n";
    //return false;
if (submitOK=="false")
    return false;


// -->

<body bgcolor="#ddeedd">
<div align="center">
<table border="0" cellpadding="0" cellspacing="0" summary="" width="580">
<tr><td align="center">

if ($send != "") {
   	echo ("To: ".$toText."<br>\r\nSubject: ".$subjectText."<br>\r\n".$msgText."<br>\r\n".$header);

<p><b><font color="#000000" size="5">Test Email</font></b></p>
<font size="4" color="#000000">

<!--   <form method="POST" action="<?php echo($PHP_SELF)?>"> -->
  <form method="POST" action="Email.php" onsubmit="return check();">
    <p><font size="3"><b>Name: <input type="text" name="nameText" id="nameText" size="46"></b></font></p>
    <p><font size="3"><b>Email: <input type="text" name="fromText" id="fromText" size="46"></b></font></p>
    <input type="hidden" name="subjectText" value="Web Mail">
    <p><font face="Arial" size="3"><b>Message Text:</b></font></p>
    <p><font face="Arial" size="3"><b><textarea rows="6" name="msgText" cols="60"></textarea></b></font></p>
    <p><font size="3"><b><input type="submit" value="Send" name="send" style="font-family: Arial; font-size: 12pt; font-weight: bold"></b></font></p>
    <input type="hidden" name="state" value="1">
  <b><font face="Arial" size="4" color="#e00000"><?php echo($announce)?></font></b><br><br>



Open in new window

Mmm very fair point about inexperienced people running their own Software :)
protechzmAuthor Commented:
Hi Dave,
Thanks for the comments,where do i need to use this code??after saving it as a php file,where do i dump it,am not sure where,is it in the the com_mailto folder??
On the issue of mass mail,maybe its going to be difficult with the spamming that goes with it,my question to all this then is how will i implement  this forum on my institutional website?i dont mind spending money on it,i want a perfect working forum.I also would like people that visit the site to be able to contact us using the form provided in the contact page which at the moment is not working;i hope what am saying is making sense;
thanks for your patience
You need to put daves code onto your server and then just run it individually. Eg if you put it in the root of your server then just go That should tell you if your email works.
protechzmAuthor Commented:
Okey,i will try this just now and report back!
protechzmAuthor Commented:
I think there is something wrong with the script on the name part,i have entered my name and email and when i click send, a message appears saying pls enter your name,pls find attached the screenshot
Change line 68


if (nam != "aaron")


if (nam == "")

Dave BaldwinFixer of ProblemsCommented:
Sorry about that.  That was leftover from a previous question.
I have a question: does your website send the registration email back to a new user? Or are all email services broken?

One thing that work like clockwork in Joomla if your email doesn't work is to fill out the SMTP email in the configuration. It needs (and works like) the same as email accounts in MS Outlook and other email programs like it.  
I don't suggest you use the Joomla Mass email to contact your users, it's a very poor method, but there must be 5 or 6 different mass email programs available for Joomla. Jnews (formerly Acajoom) always worked very reliably but there are many more.

I am sure the script posted here works fine, but one of the reasons why you use Joomla is to have all your "command center" in Joomla. Since Joomla does have HTML mass mail capabilities I think you'll find it more friendly since it works like any other Joomla component.
Jnews also has the ability to insert tags like [NAME] so you can personalize your emails and it even lets you include articles from the site. II would give it a shot. There is no reason why your email would not work. It has to be some wrong setting somewhere.
protechzmAuthor Commented:
Hi,sorry for reporting late;i was out.
,to answer your question,no the website is not sending he registration email back,nothing is working,am really struggling,i am still using test accounts both those i have created on  our domain and those using other domains such as,
DaveBaldwin: I have saved the script as email.php and put in in the one of the folders on the root server,the folder is on the webserver,the webserver is hosted at my workplace.
i am able to execute the email.php using:
Please try it and you will see the error that  appears,maybe there is something i need to do.

Many thanks
Dave BaldwinFixer of ProblemsCommented:
You didn't save it with a capital 'E' like 'Email.php'.
protechzmAuthor Commented:
Hi Dave,i have changed the file from email.php to Email.php but still have the same problem
Dave BaldwinFixer of ProblemsCommented:
You have a lot of extra stuff in there.  Like this:
>>> Not this:

>>> Like this:

Open in new window

protechzmAuthor Commented:
Hi Dave,
The script has finally worked but the mails are not coming back to my mailbox,i used my email in the form but seems the mail is getting lost along the way!
please find attached the screenshot for the result of running the script.
Where would the problem be now with these emails not being sent to the email i specificed in the script
Dave BaldwinFixer of ProblemsCommented:
Where is your server and domain located?  Right now, "" can be looked up but "" as in your email doesn't seem to exist.  Can you send email from your Gmail account to that account?
protechzmAuthor Commented:
The server is right here in my office,the domain is being hosted by
Yes i  am able to send email,for our emails.
I cant just understand why when i use the joomla form to sent to the same domain,its not working.
protechzmAuthor Commented:
Actually both web and mail servers
As I read the entire thread I get the feeling that something may not be set up properly on the server.
Having a web server activated and working does not mean the email server is also working.

If I were the poster I would follow this procedure at this point:

1)  Go to my server email tools and create an email account. Something like and make a note of: Username, password, incoming mail server, outgoing mail server.
2) With that info I would activate any email program like Outlook,  and test if the email works. If it doesn't work odds are it won't work on any script on the server.
3A) If it does work, then go to the Joomla configuration and enter the same information in the Mal settings there. and activate SMTP mail.
3B) If it doesn't work I would suggest to the poster to create a few Gmail account and read the instructions on how to set up POP3 email with Gmail.
Once the poster has that data he can enter it in the same place in Joomla and the email will work regardless of the server email.
I was able many times to have joomla send and receive emails from a localhost XAMP installation by using an external email server and entering the data in the Joomla Global configuration so I know it will work on any server/computer with an internet connection.

In general, you want to make sure that every single aspect of your system works before you go and use alternate methods. If there is a fundamental problem, such as a stopped or inactive email server you can install scripts al day none of them will work.

I may be wrong (This site font size is lubriciously small) but I don't think I have seen what type of control panel is mounted on the server, if any.
Is it Plesk? Cpanel? Something else? No control panel (meaning all of the configuration, including mail is done on the command line?). I think that information is vital. If it's Cpanel with a WHM server controller I can help as I have used it for many years. If it's Plesk or something else, others will have to pitch in but my feeling at this point is that something on the server is not configured properly.
Since Joomla lets you use any server you have access to to power its email I suggest the poster does exactly that and uses another server.

I'd actually be happy to post here an email account on one of my domain including server name, username and password and instructions on how to configure the joomla site. I can have that here tested and with screenshots in minutes from the moment I get the go ahead., I would have to send the password via PM but other than that the rest can be public.

Just let me know and we can test it that way.
Dave BaldwinFixer of ProblemsCommented:
I believe I saw earlier that you are using WAMP on your computer.  WAMP does not come with a mail server.  Did you install one?
protechzmAuthor Commented:
The mail server is running on a Bebian Linux Server,Wamp is installed on the webserver,The webserver is running on Redhat Enterprise. When you guys say the email server is not working,i dont quite understand,all of us in our institution are able to send and recieve emails,unless there is a configuration that i need to do on the webserver to correct this problem,Please  elaborate abit more about the problem with wamp,
Thanks for all the information.
Dave BaldwinFixer of ProblemsCommented:
Look at your 'php.ini' and see what it says about 'sendmail'.  There should 'sendmail_from', 'sendmail_path', 'SMTP', and 'smtp_port'.  Let us know what those values are.
protechzmAuthor Commented:
Sorry conticreative,i had posted this  before i saw your post, i have two servers like i have mentioned in the post,i think the issue of the mail server not working is i think not the case,maybe if i add to say that the mails from our domain are sent via a connector,i.e the relay agent,i dont know if this is any problem,i supposed it would still work with internal mail even if the maills were not going out right!,
Thanks for the support so far rendered,am sure we shall get to the root of this problem.
protechzmAuthor Commented:
Dave,I will check what it says when i get to the office and let you know what it says,thanks,
Dave BaldwinFixer of ProblemsCommented:
PHP is normally expecting a SMTP server on the machine it is working on unless you have set it differently.
protechzmAuthor Commented:
Directive                       Local Value      Master Value
sendmail_from      no value      no value
sendmail_path      no value      no value
SMTP                             localhost      localhost
smtp_port                                 25      25

This information for the PHP.INI is for the backup site,am assuming that its the same with the one on the server becuase i have not made any changes.
Dave BaldwinFixer of ProblemsCommented:
Ok, on Linux you will need 'sendmail' or equivalent installed and the 'sendmail_path' and possibly the 'sendmail_from'.  You may still run into a problem because from here, I can't do a lookup for "" without the 'www'.  Ask your provider to make sure that exists for your mail server.  If the SMTP server can't look it up, it can't send to it.

Another possible option is to set 'SMTP' to your mail server instead of 'localhost' but I've never tried that.
Hi protechzm. thank you for the replay.
I am really confused at the moment in regard to the server settings. Because of tat my suggestion is probably off the mark.

However, the jist of my post was that Joomla does not need to relay on whatever localhost server you have the site on.
You can use any mail server for Joomla, not just a local mail server. As long as you have the info to configure Outlook or similar program and you enter it in the global configuration Joomla will happily use that email account and the server for that email account if you specify SMTP mail.

For instance, that works for me on my XAMP installation. In my case I have a simple Modem >> Router >> PC >> Xamp setup and all my security and firewall do not prevent Joomla from using an external web sit on a live domain hosted elsewhere.

O doubt that the way your server is configured would make much difference there since the Email code is in Joomla. The only thing that could affect that would be one of the basic library Joomla uses to perform certain functions such a Curl or GD2 (for graphics).

Another suggestion I have for you, this is the fruit of many years spent troubleshooting Joomla, by the way, is to install a plain vanilla Joomla site in a subdirectory somewhere on your current site and do some testing there.

The scope of these tests is basically to help you exclude obvious culprits. If for instance the virgin Joomla site's email worked fine, then you know your server set up is OK. If it doesn't at least you know it's not something amiss with your Joomla installation.

Over the years I have solved many issues with this piecemeal approach and I found that many problems were cause by very silly things, such as an interrupted FTP transfer or missing files, wrong configuration. Even missing 'quotes' in some critical place cost me days of work.
Basically, take it one step at the time, never change more than one variable at once and don't dismiss any possibility.

Good luck.

protechzmAuthor Commented:
I have phoned my ISP and they say they can do an nslookup,without a problem.
I wondering how else i can resolve this problem,does it mean that i have to uninstall joomla on the server on which it is being hosted then install a fresh copy??,i find it easy to install and configure it on a windows machine,using wamp as usual.
I dont know alot about Linux systems and i must say here that, practicing  on these  server might cost me,coz if one goes down,then i wont even know how to bring them up.If there is a package or if one can help with a script that can run to resolve this,i would rather go that way!Any suggestions or is this the dead end for me????
protechzmAuthor Commented:
Do you think i should instead try Drupal??
Dave BaldwinFixer of ProblemsCommented:
No, I don't think you should try Drupal if you can't get my simple demo program working.  The problem isn't Joomla but making the connection to the mail server properly.  The question about the lookup is can they lookup "" as well as "" and is there a mail server record for "".  I don't know if it matters but I can't look up anything but "" from here.
protechzmAuthor Commented:
Hi Dave,
I will find out from them over this lookup issue again.
If you say joomla configuration has no issues,i find it very difficult to understand this becuase the fact that we recieve mail,send mail out anywhere to any valid account is not clear to me at all.
Iam using outlook aswell as spicebird 7 as email clients,why then should joomla fail when its supposed to just send mail via the mail server which is in the same domain and on the same network!
Am so confused now and pressure is mounting for me to get this working!!!
Dave BaldwinFixer of ProblemsCommented:
Please remember that PHP (Joomla) normally sends mail thru a SMTP server on the Same computer.  It doesn't know anything about your regular mail server.  When you use a server language like PHP to send email, you have to provide the details yourself.  It is not like a regular email client.

The info you provided before does not show a 'sendmail_path' which PHP would need to send mail from that computer.  Joomla/PHP is probably failing because it does not have access to a SMTP server on it's own machine.  Can you find out if there is a mail server / sendmail program running on the Same server as the Joomla website?
protechzmAuthor Commented:
I dont think there is becuase when it was being setup,only web service services were activated/installed.Do you mean to say the for joomla to be able to send mail, there has to be an SMTP server configured on the same Computer on which the website is sitting???If so then what mail service on this Redhat Linux server on which the website is sitting dpo we have to configure,SMTP??and how do i do it?Is there a plugin/module that joomla can use to send relay mail to the mail server instead of having to start configuring mail services on the webserver???
Dave BaldwinFixer of ProblemsCommented:
There are some plugins for Joomla that use PHPmailer which you might be able to use.  PHPmailer can use your mail server on the other machine and doesn't need the local sendmail program.  I will have to leave the choice and setup of a plugin to you.  That is way beyond the scope of this question.  You will probably have to create a special email account for the website / plugin.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
protechzmAuthor Commented:
Hi Dave,i have just noticed that my gmail account has recieved a mail from National Technology Business Centre(which is the from name in my joomla configuration),the copy you get when you fill in the contact us form.I am 100% sure that the email works now but i just dont know where it is taking the information that people are filling in when they use the contact us form.Please verify this by entering anything in the contact us form and send a copy to yourself;I found the mail in the spam folder of the gmail account.The settings for the joomla mail setup are as stated in my very first post;
So now i need to figure out where the filled in info is going;whats your take????
Dave BaldwinFixer of ProblemsCommented:
This is the form line: <form action="/index.php?option=com_contact&amp;view=contact&amp;id=1&amp;Itemid=59" method="post" name="emailForm" id="emailForm" class="form-validate">

You would have to find out where that get processed in the code.
protechzmAuthor Commented:
I dont quite understand where to check,which code am i supposed to check,where in joomla??
Dave BaldwinFixer of ProblemsCommented:
That's always a problem with complicated software like Joomla.  I honestly can't tell you where to look any better than my last comment.  The details aren't the same for every template.

I did fill out your form and I don't think I ever got an answer from it.
protechzmAuthor Commented:
Di you send a copy to your account?i think the form just accepts comments or enquiries but not sending an automatically generated email.Maybe i should get another extension for the form,so that we i try and see if it will send the entered information anywhere on the website
Dave BaldwinFixer of ProblemsCommented:
I believe I checked the box to send a copy to myself.  I'll go try it again to be sure.  I wanted to see the headers anyway.
Dave BaldwinFixer of ProblemsCommented:
I can't do it, the contact email form is not on the page anymore.
protechzmAuthor Commented:
I have just put it back on please try it again
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.