Posts

Ubuntu Setting SendEmail

1. Install Sendmail $ sudo apt-get install sendmail 2. Configure /etc/hosts file: Find your hostname by typing: $ hostname Then: $ sudo nano /etc/hosts On the line starting with  127.0.0.1 , add the  hostname  to the end so it looks the same as: 127.0.0.1 localhost hostname (You willl notice that your  hostname  can also be identified on the line that starts with  127.0.1.1  where it appears twice) Ctrl+x, then ‘Y’ to save and exit. 3. Run Sendmail’s config and answer ‘Y’ to everything: $ sudo sendmailconfig 4. Restart Apache $ sudo service apache2 restart 5. Using sendmail: To quickly send an email: $ sendmail -v someone@email.com After hitting the enter key, on the line directly below, enter a From address (each line after you hit enter will be blank): From: you@yourdomain.com Hit enter again and type a subject: Subject: This is the subject field of the email Hit enter again and type the message: This is the message to be sent. Hit enter again. To send the email, type a ‘ . ‘ (period