Question

What task should be done to send email from the server?

Hi,

I am new at linux configuration. My problem is: I do not what tasks should be done to enable sending email from the server. Normally we use contact form where we use php mail() function. I want when I use this function, I would be able to send email. So, please could you guide me anyone as how to configure or which package should be installed.

Moreover, I tried something reading this link https://www.digitalocean.com/community/questions/php-mail-script-does-not-work and use the following command:

sudo apt-get install sendmail

And then applied this command:

sudo netstat -plutn | grep 25

And find the result:

$ sudo netstat -plutn | grep 25
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1293/sendmail: MTA:

However, please help what I should do in this circumstance.

Thanks in advance, Shimul


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

One more thing to try:

sudo apt-get install mailutils

Yes I am getting email using the command: sendmail -v your@email.org < mail.txt

try a external service and forget about configuration, if you know php you can handle an external service, but if you don’t know how to config a mta service on linux (which can bring you several problems, like open relays, blacklists, etc) then use an external service, I use mandrill which is almost free and pretty good, also gives you a lot of useful information about your email tasks.

here: https://mandrillapp.com/