Visual FoxPro application needs to send E-mail using Office 365 e-mail server
I tried to use CDO 2000 class from https://www.berezniker.com/content/pages/visual-foxpro/cdo-2000-class-sending-emails but failed.
Attempt 1:
Tried to use 587 port but it does not work. According to Error sending email using CDO on port 587 (TLS) 587 port is not supported by Windows CDO. 465 port is not suppored by Office 365.
Attempt 2:
Tried to use 25 port with smtp.office365.com server according to
but on some computers office mail server throws error "bare line feed not supported". I changed CDO class to encode attacments in base64:
result = .AddAttachment(lcAttachment)
result .ContentTransferEncoding = "base64"
but this error still occurs. I saved message to eml file and verified that it does not contain bare line feeds.
Error details:
Your message contains invalid characters (bare line feed characters) which the email servers at geopipes.ee don't support.
Bare line feeds unsupported
How to Fix It
It appears that your email program added invalid characters (bare line feed characters) into your message when you sent it. Try using a different email program to send your message. If the problem continues send this non-delivery report (NDR) message to your email admin for assistance.
More Info for Email Admins
Status code: 550 5.6.11
This error occurs when the email program or device used to create or send an email message adds bare line feed characters into the message. When bare line feed characters are included in a message, the SMTP protocol chunking feature is required to transmit the message between email servers. Chunking uses the SMTP protocol BDAT command, but the recipient's email server doesn't support the BDAT command.
To fix the issue, the sender should send the message using an email program or device that doesn't add bare line feed characters to messages. Most modern email programs don't add bare line feed characters.
If the sender is using a device like a fax machine, printer, or scanner, it's likely an older model that doesn't support the SMTP protocol BDAT command. To fix this error, you'll need to replace the device with a newer model that supports the BDAT command. The industry standard recommendation to support SMTP chunking was published in 1998 so most devices manufactured during the last decade support this feature.
Another option is for the email admin at the recipient's domain to upgrade their email servers to servers that support the SMTP protocol BDAT command. Most modern email servers support BDAT; however, some free and older email servers don't support it.
For more information see Fix email delivery issues for error code 5.6.11 in Office 365.
How to send e-mails from VFP application using office 365 mail server ? Should https://github.com/DougHennig/SFMail class or some command line mailer or dll used?
