1、背景
开发OJS投稿系统,用户注册、投稿、审稿等操作需要给用户发送一份确认邮件。
2、邮件
投稿系统使用25端口发送邮件,默认配置如下:
;;;;;;;;;;;;;;;;;;
; Email Settings ;
;;;;;;;;;;;;;;;;;;
[email]
; Use SMTP for sending mail instead of mail()
smtp = On
; SMTP server settings
smtp_server = smtp.163.com
smtp_port = 25
; Enable SMTP authentication
; Supported mechanisms: PLAIN, LOGIN, CRAM-MD5, and DIGEST-MD5
smtp_auth = PLAIN
smtp_username = ******@163.com
smtp_password = ******
3、问题
投稿系统部署到阿里云服务器上后,发现服务器封掉了25端口,联系客户后,说可以使用465端口
4、解决方案
使用465端口,配置文件如下:
;;;;;;;;;;;;;;;;;;
; Email Settings ;
;;;;;;;;;;;;;;;;;;
[email]
; Use SMTP for sending mail instead of mail()
smtp = On
; SMTP server settings
smtp_server = ssl://smtp.163.com
smtp_port = 465
; Enable SMTP authentication
; Supported mechanisms: PLAIN, LOGIN, CRAM-MD5, and DIGEST-MD5
smtp_auth = PLAIN
smtp_username = ******@163.com
smtp_password = ******
如上,只需要修改smtp_server和smtp_port即可。