Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using ubuntu 12.04 and I have installed Appache , php , and mysql all the latest versions. I have my website on the root folder of this machine. Now, I want an email be sent to my boss when ever some one downloads a document from the website after filling the form. I already have designed a form and made all the neccessary validations as well. But I do not know how to send those form contents to my boss in her email address!!

I love ubuntu and am Enjoying it and am a beginner! would any one please help me?? Thank you so much! Joye

share|improve this question
Is this a question about the server setup or a PHP question asking how to send form contents via email? Or both? – Oli May 8 '13 at 12:02
Do you have SMTP installed? – Mitch May 8 '13 at 12:03
up vote 0 down vote accepted

Start with installing a MTA. This lets PHP send the email from the server.

sudo apt-get install postfix

Then in PHP it's fairly simple. Use the mail command:

mail('', 'Form submission', $_POST['message']);

That assumes there was a form element with the name message in the form. It also assumes your form is (as it should be) <form method="post" ...>.

share|improve this answer
Thank you very much!! I will try that! – Joye May 9 '13 at 8:41
A good friend of mine told me to install sendmail for this problem as a solution and I did. I also configured the [mail function] and I tried to send emails...the message from the php code I wrote told me that the email has been send successfully but, there is nothing received when i go and check my emails. I also tried to look at some solved problems ... but I am confused identifying between localhost and localdomain ... I came accros an advise that suggests to edit /etc/hosts file.. my virtual computer name is ABC-HR-System, my hostname (by the result of the command hostname is)xyz. hlp, pls – Joye May 10 '13 at 10:13

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.