Setting up email

0

So I'm a bit confused and need direction.

I am building a website which contains a "Contact Us" page.

I host this site using nginx as the web server and has sendmail as an MTA.

The confusion is whether or not a mail server is needed or do I just do everything through nginx.

I set up the contact us page and used php's mail() funciton and got back false. As in nothing was sent. After asking for help some gent told me to pass the arguments to sendmail. After further reseach, I found that sendmail is used by command line only. If this is the case, then there's no point in using sendmail for the "Contact Us" page.

I don't want to set up a mail server to use for personal use, just to send email messages from the website to a gmail account....ok maybe just forward that message to a gmail account.

Would someone please some me understand this concept.

Brad

Posted 2019-06-09T22:03:09.827

Reputation: 1

Answers

0

The confusion is whether or not a mail server is needed or do I just do everything through nginx.

Typically, you need a mail server.

The exception to this "rule" is that if you only want to send email (not receive or actually forward it), some scripting languages (such as PHP) have functions that can be called in scripts by a web server to send emails directly (as you found out).

Nginx by itself (sans scripting lanuages) has no email functionality whatsoever.

I found that sendmail is used by command line only. If this is the case, then there's no point in using sendmail for the "Contact Us" page.

The "Contact Us" page will never be in anything but HTML (even if it is produced by a script). I think the point here would be that using sendmail or another similar program would be potentially more reliable than messing around with a scripting language's built-in functions.

Anaksunaman

Posted 2019-06-09T22:03:09.827

Reputation: 9 278