How do I specify SMTP server for an e-mail in PHP?

后端 未结 2 1044
陌清茗
陌清茗 2021-01-27 07:07

I want to send an e-mail through a PHP script in Linux. My code is as follows:

$to = $row[\'EmailID\'];
$subject = \"XYZ\";
$message = \"yes!!!!\";
$from = \"pal         


        
2条回答
  •  半阙折子戏
    2021-01-27 07:37

    You can specify your SMTP server in your php.ini file

    Check this thread for example: http://board.phpbuilder.com/showthread.php?10307560-CONFIGURING-php-ini-%28Setting-the-SMTP%29!!!

    If you want to do it inline, you can try changing these settings with ini_set();

提交回复
热议问题