开发者

How can create email id using shell_exec or exec in 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 applicati开发者_如何学Pythonon.

All help is appreciated.


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.


I would use an php email library like swiftmailer: http://swiftmailer.org/

It would be possible to compose an email by "exec" and another tool, but there are too many risks/problems with that approach.


In other words @Tobias, shahul it trying to create an e-mail account from command line.

@shahul, what kind of e-mail account are you trying to create? Is it a GMail/Yahoo!, etc free e-mail account or are you talking from an MTA level, and if an MTA, what operating system and MTA are you talking about?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜