How to send email from localhost using PHP on Linux

前端 未结 7 2073
别那么骄傲
别那么骄傲 2020-12-09 19:25

I know that to send e-mail from localhost on Windows, you need to change SMTP server in php.ini however this is valid only on Windows:

[mail function]
; For         


        
7条回答
  •  轮回少年
    2020-12-09 20:20

    If you're running Debian and variants thereof (*buntu, etc.), you can install a mail server by running sudo tasksel install mail-server, which should set you up with basic email capabilities. You can test this by running in command line echo 'body' | sendmail recipient@example.net, or as others have mentioned, mail($to, $subj, $msg) in PHP.

提交回复
热议问题