How do I Send authenticated e-mail from VBA?

Many years ago I wrote some code to send e-mail messages out from a database that I use in my store.  Recently, we  changed to office365 and now many of my customers are not get their e-mails because their system is blocking them.  It saying that my e-mails are not authenticated.  Gmail seems to be blocking my e-mails.  I use CDO code (Below), but I think I have to change up.  But I don't know how to send authenticated e-mails.  How do I fix this?

My current code:

                    Config.Fields(cdoSendUsingMethod) = cdoSendUsingPort
                    Config.Fields(cdoSMTPServer) = rsSetUpTbl![SMTP ServerName]
                    Config.Fields(cdoSMTPServerPort) = 465
                    Config.Fields(cdoSMTPAuthenticate) = cdoBasic
                    Config.Fields(cdoSMTPUseSSL) = 1
                    Config.Fields(cdoSendUserName) = rsSetUpTbl![UserID]
                    Config.Fields(cdoSendPassword) = rsSetUpTbl![Password]

                    Config.Fields.Update
                    MyMessage.Configuration = Config

                    MyMessage.To = rsEmailTbl![Email Address]
                    MyMessage.From = rsSetUpTbl![Email Address]
                    MyMessage.Subject = rsSetUpTbl![Email Subject]
                    MyMessage.TextBody = EmailTxt

                    MyMessage.Send

                    Set objEmail = Nothing
dmailboxAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
and now many of my customers are not get their e-mails because their system is blocking them.  It saying that my e-mails are not authenticated.  Gmail seems to be blocking my e-mails.
it could be due to the content of email you sent. Is your email content properly formatted?

Why Your Emails Get Blocked or Filtered?
https://glockeasymail.com/email-marketing/emails-blocked/
0
dmailboxAuthor Commented:
I do not believe that it is the formatting of the e-mail.  It is a simple text message with no HTML or special characters.  It's just a simple message letting our customers know that they received a package.  The same e-mail that has been going out since 2006.
0
Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
sorry as seems this question was neglected...

I do not believe that it is the formatting of the e-mail.  It is a simple text message with no HTML or special characters.
well things can get changed... so we cannot guaranteed what used to work well is always working well let's say 10 years later. there could be a lot dependencies why an email can't reach or went to the spam folder. the email content is definitely one of the reasons.
0
dmailboxAuthor Commented:
I was able to get around the issue by sending the e-mail through the MS-Outlook client.  That seems to have solved the issue.  I just had to load Outlook on the computer that is running the software.   Not the best solution, but it seems to be working....
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
dmailboxAuthor Commented:
I found an alternative solution on my own.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VBA

From novice to tech pro — start learning today.