Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can create email id using shell_exec or exec in php?

Tags:

linux

php

How can create email id using shell_exec or exec commands in PHP.

That is: I want to create an email id in my web application.

All help is appreciated.


1 Answers

On Linux, you've got a few choices, but most aren't practical from a web script point of view, as they require root permissions and/or substantial modifications to the server for initial setup.

  1. add an entry to /etc/aliases to forward your new virtual mailbox to an existing account (on the same system or elsewhere) (requires root permissions)
  2. create a physical system account (requires root permissions)
  3. Set up a virtual mail server using a standard SMTP server, mysql, and dovecot (I've used postfix for this successfully). Much harder, but makes adding accounts a snap as it's simply a new database record.
like image 109
Marc B Avatar answered Jun 09 '26 03:06

Marc B



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!