Peter's Portfolio

[SYNOLOGY] How to Configure SMTP mail via PHP

Since Synology Web Station released. PHP function had been combine in Web Station GUI. The problem is the configuration of the ssmtp application, which is broken for now. I have no idea if Synology will fix it or not.
To make smtp via php work properly. You should 1.Install the Synology Mail Server application. 
Note:If you want to use an external mail server (as I do), you MUST set it up as an SMTP relay.

This is what I have done, since I run my own mail server on a different box. I assume you can also set it up to relay through other email services such as Gmail .

2.Once you have set up Mail Server, make the following changes from a command prompt session, open php.ini file with Web station GUI.
smtp: localhost
sendmail_from = youremail@yourprovider
sendmail_path = /var/packages/MailServer/target/sbin/sendmail -t

3.After restarting Apache the ini-file gets loaded, and PHP can send mails again.
To access terminal via ssh: ssh username@serveraddress (remember to enable 22 port for ssh)
synoservicectl –restart httpd-user

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *

這個網站採用 Akismet 服務減少垃圾留言。進一步了解 Akismet 如何處理網站訪客的留言資料