简体   繁体   English

使用php将邮件发送到本地Exchange Server

[英]Send Mail to Local Exchange Server using php

Is it possible to send mail to an exchange server that is running locally on our network using php-apache that is also running in a localhost? 是否可以使用也在本地主机中运行的php-apache将邮件发送到在我们的网络中本地运行的交换服务器? If its possible, can anyone point me to the right direction? 如果可能的话,有人能指出我正确的方向吗?

Thank You Guys in Advance 提前谢谢你们

The easiest way is to just to install a local MTA like blatmail (assuming you're on Windows; if you're on Linux you have sendmail or an equivalent already and mail() should just work). 最简单的方法是仅安装像blatmail这样的本地MTA(假设您使用的是Windows;如果您使用的是Linux,则已经有sendmail或等效的邮件,并且mail()应该可以正常工作)。

That said, assuming your Exchange server will forward without authentication from the local network, set SMTP to the address or hostname of your Exchange server in .ini (or ini_set "SMTP" to that in the script itself). 就是说,假设您的Exchange服务器将进行转发而无需从本地网络进行身份验证,则将SMTP设置为.ini中Exchange服务器的地址或主机名(或将ini_set“ SMTP”设置为脚本本身中的地址)。

Note that the vanilla mail() doesn't support authentication, and I'm pretty sure doesn't support TLS. 请注意,普通mail()不支持身份验证,而且我很确定不支持TLS。 So you should definitely only use it on a completely trusted network. 因此,您绝对应该只在完全受信任的网络上使用它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM