Linux – the easiest way to setup a linux server to send mail

emaillinuxPHPUbuntu

I'm just about finished setting up the basics of my new ubuntu server – I don't have very much experience with Linux.

I only need to be able to send email from my server – but it seems to be really difficult to set it up.

I tried this answer, but I simply get the same error in my log as I did before I installed postfix…

sh: /usr/sbin/sendmail: not found 

I now have postfix installed, and have added the configuration file in my PHP config directory as that answer suggests – but I still encounter the same issue when sending emails with PHP.

What is the easiest way of setting this up to send emails through PHP with ubuntu server?

Best Answer

If you installed postfix, you can find the path of sendmail using:

$ sudo dpkg -L postfix | grep sendmail
/usr/sbin/sendmail
/usr/share/man/man1/sendmail.1.gz
/usr/lib/sendmail

So, sendmail should be installed as part of postfix package. Maybe, you need to make sure you have installed postfix successfully.