需要从网站发送电子邮件

时间:2018-07-25 08:57:27

标签: php email

我使用sendmail.ini文件通过wampserver从我的网站发送电子邮件

smtp_server=smpt.office365.com
smtp_port=587
smtp_ssl=tls
auth_username=example@ul.edu.lb
auth_password=*******
hostname=www.biotech.ul.edu.lb

这是php.ini:

[mail function]
; For Win32 only.
; http://php.net/smtp
;SMTP = localhost
; http://php.net/smtp-port
;smtp_port = 587

; For Win32 only.
; http://php.net/sendmail-from
;sendmail_from = 

; For Unix only.  You may supply arguments as well (default: "sendmail -t - 
i").
; http://php.net/sendmail-path
sendmail_path =C:\wamp\sendemail\sendmail.exe

但这没用。错误是:

Warning: mail(): Failed to connect to mailserver at 
"smtp.office365.com" port 587, verify your "SMTP" and 
"smtp_port" setting in php.ini or use ini_set() in 
C:\wamp\www\biotech\php\sendEmail.php on line 35

有人可以帮助我吗?

0 个答案:

没有答案