當前位置:首頁 » 編程語言 » 郵件伺服器php

郵件伺服器php

發布時間: 2025-03-17 11:09:42

1. php 發送郵件 要怎麼配置

在Windows平台下使用mail函數發送郵件,記錄如下

php.ini的設置:

SMTP = localhost
smtp_port = 25
sendmail_from=你的設定值

另外,還需要安裝IIS自帶的SMTP,在SMTP虛擬伺服器上點擊右鍵,在彈出的屬性窗口裡進行如下設置:
點擊訪問選項卡,再點擊中繼,在彈出的窗口出點擊添加,然後選單台計算機,添加IP地址為 127.0.0.1。然後一路確定返回。(不進行此項設置,可能會出現:SMTP server response: 550 5.7.1 Unable to relay for [email protected]。。。的錯誤)

這樣就可以使用mail函數了

<?php
mail("[email protected]","Test mail function of PHP.","hello world!");
?>

熱點內容
主機域名是不是伺服器地址 發布:2025-04-26 22:27:19 瀏覽:124
低配置手機能玩哪些吃雞手游 發布:2025-04-26 22:24:35 瀏覽:292
穿越火線的截圖在哪個文件夾 發布:2025-04-26 22:15:55 瀏覽:730
java線程啟動線程 發布:2025-04-26 21:58:34 瀏覽:128
commonlisp編程 發布:2025-04-26 21:56:08 瀏覽:236
如何實現輸入伺服器ip就進入網站 發布:2025-04-26 21:56:07 瀏覽:944
我的世界國際版伺服器設置有問題 發布:2025-04-26 21:41:10 瀏覽:63
為什麼腳本錯誤 發布:2025-04-26 21:29:10 瀏覽:887
太湖之光編譯器 發布:2025-04-26 21:23:01 瀏覽:153
android掃描框 發布:2025-04-26 21:14:50 瀏覽:449