知識庫

如需移除,請網站管理者移除.

如何利用XAMPP‧在本機(localhost)環境下用SMTP伺服器寄送 電子郵件
主題:


發佈者:terry8899@grapes.tw
文章編號:2068 2024-08-22 03:31:11   來自:219.84.252.165   

回覆



1樓. 回覆 : 2068 時間 : 2024-08-22 03:50:10

打開XAMPP的php.ini檔案,更改以下內容:

將:
; extension=php_openssl.dll
更改為:
extension=php_openssl.dll


在[mail function]位置,將:
SMTP=localhost
smtp_port=25
;sendmail_path =
更改為:
SMTP=smtp.gmail.com
smtp_port=465
sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"

打開XAMPP的sendmail.ini檔案,正常sendmail.ini檔案是位於c:\xampp\sendmail資料夾內。

在[sendmail]位置,將:
smtp_server=mail.mydomain.com
smtp_port=25
auth_username=
auth_password=
更改為:
smtp_server=smtp.gmail.com
smtp_port=465
auth_username=<your gmail login>
auth_password=<your gmail password>

約41行
force_sender=sample@gmail.com ← gmail信箱


stunnel
stunnel.conf 檔,位置在 C:Program Filesstunnelstunnel.conf
原本是註解的就拿掉分號,取消註解。

cert = stunnel.pem
socket = l:TCP_NODELAY=1
socket = r:TCP_NODELAY=1
debug = 7
output = stunnel.log
client = yes

[ssmtp]
accept = 127.0.0.1:25
connect = smtp.gmail.com:465
 


所有程式與圖片和影片版權皆歸原作者,出版商,製造商所有,若有侵權請來信告知,謝謝。

Copyright 2013 台豐實業
如有任何問題或合作提案歡迎私訊或來信 E-Mail 與我們聯絡 service@grapes.tw  / 台豐實業  
本網站僅支援桌上型PC版本,並不適用於手機,平板電腦