• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 41
  • Last Modified:

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
0
dmailbox
Asked:
dmailbox
  • 3
  • 2
1 Solution
 
Ryan ChongCommented:
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 ChongCommented:
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
 
dmailboxAuthor Commented:
I found an alternative solution on my own.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now