开发者

Sending mail in PHP using Exchange SMTP

I have a client that uses Exchange (although I'm not sure which version). From what I know, they do have an SMTP for their Exchange however supposedly I cannot use it since my system is on PHP+Linux. It will not work for the Exchange being on Windows licensed server. How true is it? I am trying to send the mail through SMTP and not directly to the Exchange server.

They did give the details on the SMTP and I have tried and yes, it doesn't work. I got an error 'Could not connect to SMTP host'.

What are my other options in sending mail through PHP? Been googling around and found something ca开发者_JAVA技巧lled WebDav. Would that be a wise choice?

EDIT> I guess something went right overnight however it's not everything. I can (presumably) connect to the SMTP however I can't send email to other domains. I tried sending to it's own domain and it works. Checked my inbox and the email is there however if I send to Live or GMail, it doesn't work. It gives me this error:

PHPMAILER_RECIPIENTS_FAILEDemail@email.com

The email@email.com is a correct existing email. I have even tested with GMail and there's no problem in sending. Now what I would like to know is where the problem lies. Could it really be in the coding or the SMTP server?

As an extra note, I'm using Joomla 1.5.22.


They are incorrect. SMTP is a standardized protocol and has nothing to do with the operating system used from a client. Exchange has a few particular things that are somewhat odd about how it handles SMTP but they will more than likely not matetr for you.

If you're getting a 'Could not connect to SMTP host', that's a pretty fundamental issue it means one of several things:

  1. The server is not accepting inbound SMTP from anyone
  2. The server is not accepting inbound SMTP from your IP
  3. There is a firewall getting in the way.

There are a lot of ways to troubleshoot this. The easiest, assuming this is a server that should be accessible to the general internet, is to, from a command prompt, run 'telnet 1.2.3.4 25' (where 1.2.3.4 is the IP where the server should be). If that connects, then see if you can run the same command from the machine where your PHP is. If not, tell the client that you can't seem to access SMTP from the outside and see if they can troubleshoot.


You could use gmail? I know you might not be using phpmailer, but the how-to should set you in the right direction.

It sounds like "they" (who I'm guessing are the sys-admin for the network you're on?) may have other ideas on you doing this though - ports could be restricted etc.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜