Office365 SMTP AUTH XOAUTH2 Fails with “535 5.7.3 Authentication unsuccessful”

If you successfully minted an OAuth2 access token for your Azure Entra Id App, but then it fails when attempting to use it in the SMTP protocol for sending email with the error: AUTH XOAUTH2 user=xxx auth=Bearer ********************** 535 5.7.3 Authentication unsuccessful [BN9PXXXA0336.namprd03.prod.outlook.com 2024-04-16T12:11:26.548Z 08DC9999186DF999] Check your Entra Id App Registration to make sure you have the following App Permissions:

Solved: Mail Server Error “message body contains illegal bare CR LF characters”

A Chilkat user reported suddenly getting an error message from two receiving mail servers when sending mail generated by Chilkat. The message is:   message body contains illegal bare CR LF characters  Solution:  The cause has been found. The affected users are using AVG or Avast Antivirus and there is an optional signature text added after the outgoing email scan. If […]

SMTP Timeout Sending Large Email

Question: While trying to send an email with an attachment of size 9MB from my application, I get an error.  Interestingly, the file gets delivered to the email address still we get the error in the application. Answer: Looking at the MailMan.LastErrorText for the call to SendEmail, we can see this: ChilkatLog: SendEmail: … ReadTimeout: 30000 … … sendCmdToSmtp: SmtpCmdSent: […]

Office365 Modern Authentication for IMAP, POP3, and SMTP

This post documents how to implement Modern Authentication (OAuth2) for Office365 for the IMAP, POP3, and SMTP protocols.  The very first thing you’ll need to do is to create an “App Registration” in Azure Active Directory. See this Chilkat blog post for Instructions for Setting Up an App Registration in Azure for Modern Authentication for IMAP, SMTP, and POP3. It’s […]

Create Azure App Registration for use with IMAP, POP3, and SMTP

1) Go to https://portal.azure.com/#home and login to your Microsoft account. then go to Azure Active Directory.   2) Click On App Registrations * Copy your Tenant ID, you’ll need it later. 3) Click on “+ New registration” 4) Name your App and Click Register. Give it a name. For the Redirect URI, select “Web” and then use “http://localhost:3017/”. Your application […]

AutoFix POP3 and SMTP Port / TLS Settings

What is the MailMan.AutoFix property? Protocols such as POP3, SMTP, FTP, IMAP, etc. that sit atop SSL/TLS in the protocol stack, can establish TLS connections in one of two ways:  explicit or implicit. Implicit SSL/TLS means that immediately after the TCP connection is established, it is implicitly known that client and server will begin with the TLS handshake. Explicit SSL/TLS […]

Authentication Problem with Sending Email in Office365 using SMTP

If SMTP authentication (using login/password) fails for your smtp.office365.com account, then it may be that your account is configured to require MFA (multi-factor authentication).   You may need to change settings to allow for legacy authentication (single-factor auth).   See https://docs.microsoft.com/en-us/azure/active-directory/conditional-access/block-legacy-authentication Also, an app password may be required.  See https://docs.microsoft.com/en-us/azure/active-directory/user-help/multi-factor-authentication-end-user-app-passwords