Send Email from Hotmail.com, Live.com, or Outlook.com

Question:  I want my desktop application (or script) to send email from my Hotmail.com account (or my Live.com or Outlook.com account).  My application will connect to the SMTP server for hotmail.com, authenticate using OAuth2, and send the email.  I want to use Chilkat’s MailMan class to do it.  I’m completely lost.  Where do I even begin? Answer: I fully understand […]

SMTP Server Settings for Hotmail.com, Live.com, and Outlook.com

(back to Send Email from Hotmail.com, Live.com, or Outlook.com) The SMTP settings for Hotmail.com, Live.com, and Outlook.com are the same because all these email domains are part of Microsoft’s unified Outlook email service, which uses the same mail servers. Here are the SMTP settings: SMTP Server Settings (for sending email): SMTP Server: smtp.office365.com Port: 587 Encryption: STARTTLS Requires Authentication: Yes […]

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 SMTP: 535 5.7.139 Authentication unsuccessful, SmtpClientAuthentication is disabled for the Tenant.

This blog post is about the following error encountered when trying to send email via Chilkat.MailMan.SendEmail (using the SMTP protocol). smtpAuthenticate: smtp_host: smtp.office365.com smtp_port: 587 smtp_user: **** smtpAuthenticate: login_method: XOAUTH2 auth_xoauth2: username: **** sendCmdToSmtp: SmtpCmdSent: {PasswordOrCredentials} –sendCmdToSmtp readSmtpResponse: SmtpCmdResp: 535 5.7.139 Authentication unsuccessful, SmtpClientAuthentication is disabled for the Tenant. Visit https://aka.ms/smtp_auth_disabled for more information. [****.PROD.OUTLOOK.COM 2023-07-03T11:15:43.462Z ****] –readSmtpResponse –auth_xoauth2 Failed […]

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 […]

smtp.office365.com – Failed to get initial SMTP Response

If something on the client-side is blocking communications, such as a hardware or software firewall, or anti-virus, then it may be that a TLS connection is established, but then trying to read the 1st message from the server gets blocked.  When this happens, the contents of the LastErrorText look like this.   (The LastErrorText for a successful connection is shown below.) […]