Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does PHP mail() require a mail program like sendmail/postfix/etc. for sending emails?

Tags:

php

email

Why does the PHP mail() function require a mail program like sendmail/postfix/etc. for sending emails?

I ask because sending email is a client action and not something that needs to run a server.

What is so complicated about creating a native PHP mail function without the need to install a sendmail/postfix/etc. program that has excessive functionality as a server that can get requests and not just send email as a client?

like image 206
Ben Avatar asked Dec 28 '22 01:12

Ben


1 Answers

Most likely: sendmail existed before PHP's mail(), so in the true spirit of *nix:

Why re-create functionality when it already exists on the CLI?

like image 155
drudge Avatar answered Feb 07 '23 10:02

drudge