Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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
1  
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
1  
Do you have SMTP installed? –  Mitch May 8 '13 at 12:03

1 Answer 1

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('address@example.com', '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

 
discard

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.