Exchange server won't authenticate sending email

I have a client I’m writing a Windows desktop app for that needs to send email to the client’s customers. The client is running Exchange 2007 on Small Business Server 2008. It is set for basic authentication as well as TLS (though their TLS certificate has expired). Their phone system accesses Exchange via basic authentication without any problems, and so that’s what I tried using, but it fails with SMTP error 530, saying “Client not authenticated”.

I’m using Xojo R2015r4.1, and I have an SMTPSocket on my app’s email window. I set the .address, port, .username, .password, append a header, and .AddRecipient and .bodyPlainText, then append the email message and do a .sendMail. This same code works great on my desktop at home (Mac and Windows), which isn’t using Exchange.

I had the client’s head of IT engineering with me yesterday, and when he turned off all authentication, the email went through, but they won’t leave their system that way for normal use. He tried entering every combination of username and password we could think of, but no luck. He was interested in seeing the actual data conversation happening between my app and the Exchange server, but I didn’t know of any way to watch that using Xojo.

They have the capability to use TLS (if they renew their certificate), but I don’t know how that could work if basic authentication doesn’t work.

Does anyone with Exchange experience have any suggestions for what the problem might be?

It’s possible the server won’t allow authentication over a plain text connection. You could try using the secure version of smtpsocket and having it connect with tls. That might work.

If you want to really know what’s happening, download wireshark and capture the traffic. You should be able to see the plain text conversation between the app and the server. That may tell you more precisely what’s happening.

There are a lot of settings on the Exchange server that might affect this, and if the wireshark capture doesn’t make it obvious what the problem is, you will need the IT guy to go through and check the exchange server to see what’s going on.

I’ll try the secure SMTP and see if that helps.

I’m having trouble reading WireShark’s home page, though I can download the software from other links. I get a message from Safari saying “Too many redirects occurred trying to open ‘’”.


I routinely authenticate with Exchange using a Web App running on Windows Server 2008 but it does use TLS. I also authenticate with Microsoft Office 365 email. I am not sure of the Exchange version.

If you cannot resolve your problem I will post a code snippet.

Wireshark may help identify the problem if you you are patient and can compare a successful authentication with some other client and one that fails with your Xojo program…

I didn’t have any issues with Safari and the wireshark page, but check this out, it might help.