简体   繁体   中英

php mail function

我被问及php mail()函数,它是从linux发送的吗?还是取决于源代码所在的位置?

It is sent from your server; if it's Linux, Linux will send it, if it's Windows, Window's will send it. If you want to use a different server to send your mail look into SMTP

See the documentation on mail() .

On Linux, the local sendmail binary is used.

On Windows, where there is no such binary, you need to specify a (local or remote) SMTP server to send out E-Mail (See the "Windows" comments in the documentation.)

For anything more complex - like using SMTP with authentication, or a remote SMTP server, sending out many mails at once, handling attachments etc. there are powerful PHP libraries like Swiftmailer that can totally circumvent the mail() command. It is often a good idea to use one of those from the start.

请参考以下链接以获得mail()详细文档http://www.php.net/manual/zh/function.mail.php

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM