PHP Classes

Use of ntlm_sasl_client in PHPMailer

Recommend this page to a friend!

      Simple Authentication and Security Layer  >  All threads  >  Use of ntlm_sasl_client in PHPMailer  >  (Un) Subscribe thread alerts  
Subject:Use of ntlm_sasl_client in PHPMailer
Summary:NTLM support in PHPMailer
Messages:8
Author:Jim Jagielski
Date:2012-01-16 16:38:08
Update:2012-07-19 09:54:02
 

  1. Use of ntlm_sasl_client in PHPMailer   Reply   Report abuse  
Picture of Jim Jagielski Jim Jagielski - 2012-01-16 16:38:08
Manuel,

I'm looking at adding NTLM support in the next rev of PHPMailer and the ntlm_sasl_client.php package is just what I need.

I see that it's BSD licensed but still wanted to see if you had any issues if I used and bundled the package in PHPMailer (with attribution, of course).

--

Jim

  2. Re: Use of ntlm_sasl_client in PHPMailer   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2012-01-17 00:11:26 - In reply to message 1 from Jim Jagielski
No problem. A link back to the SASL class would be nice though.

  3. Re: Use of ntlm_sasl_client in PHPMailer   Reply   Report abuse  
Picture of Hassan Hassan - 2012-07-18 11:45:20 - In reply to message 2 from Manuel Lemos
Hi there

I'm struggling to get the PHPMailer work with NTLM, please help me out.

What additional libraries / files should I use?

I've installed PHP+Apache on windows 2008 R2 and there is a MS Exchange server which need to relay the email.

when I do telnet to the host it connects on 25 port and shows me the auth type as 250-Auth NTLM

I've never used this in past, any help would be greatly appreciated.

  4. Re: Use of ntlm_sasl_client in PHPMailer   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2012-07-18 12:08:26 - In reply to message 3 from Hassan
Sorry, I cannot help you with PHPMailer because I do not use it, you would need to ask its author.

I use the MIME message class that I also wrote and it works well with the SASL. If you would like to try it, take a look here:

phpclasses.org/mimemessage

phpclasses.org/smptclass

  5. Re: Use of ntlm_sasl_client in PHPMailer   Reply   Report abuse  
Picture of Hassan Hassan - 2012-07-18 17:39:29 - In reply to message 4 from Manuel Lemos
Thanks for a blazing fast reply.

can I use your SMTP class and send mails by authenticating the MS Exchange server? Auth-NTLM?


  6. Re: Use of ntlm_sasl_client in PHPMailer   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2012-07-19 00:15:04 - In reply to message 5 from Hassan
Yes, you should use the SMTP class in conjunction with the MIME class for composing the message according to the e-mail standards and the SASL class for NTLM authentication.

  7. Re: Use of ntlm_sasl_client in PHPMailer   Reply   Report abuse  
Picture of Hassan Hassan - 2012-07-19 07:55:28 - In reply to message 6 from Manuel Lemos
i've downloaded the script and trying to execute them. I'm getting Authentication Unsuccessful message.

I'm giving the following, please confirm if they are correct

$smtp->user="SMTP USER NAME, WHICH IS EMAIL ID";
$smtp->realm="THE DOMAIN OF THE EMAIL ID, domain.com";
$smtp->password="EMAIL PASSWORD";
$smtp->workstation="networkdomain\WORKSTATION NAME";
$smtp->authentication_mechanism="NTLM";

  8. Re: Use of ntlm_sasl_client in PHPMailer   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2012-07-19 09:54:02 - In reply to message 7 from Hassan
The user name and password are the ones used to login in your Windows workstation for the requested Windows domain.