[PHP] Send mail with remote SMTP server

| | Comments (1)

主機若沒有跑 mail service, 要用 PHP 透過其他 SMTP 來寄信,
Windows 下可以改 php.ini
[mail function]
SMTP = smtp_server
其他 UNIX 環境, 不支援上面的方法, 真怪.
大致有兩種做法:
1. 使用現成 Class, 如 PEAR::Net_SMTP, phpguru.org - SMTP class, 這些 Class 是透過 fsockopen() 的方式寄信
2. 裝 Light SMTP Agent, 如: mini_sendmail
然後改 php.ini 裡的 sendmail_path
sendmail_path = /usr/local/sbin/mini_sendmail -s smtp_server -t

1 Comments

第一種作法裡,常見的還有 PHPMailer - http://phpmailer.sourceforge.net/

Leave a comment

March 2009

Sun Mon Tue Wed Thu Fri Sat
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        

About this Entry

This page contains a single entry by Pank published on March 7, 2007 11:13 AM.

Google Translate was the previous entry in this blog.

BIND dump cache is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.