The nitrogen in our DNA, the calcium in our teeth, the iron in our blood, the carbon in our apple pies were made in the interiors of collapsing stars. We are made of starstuff.
I have finished less than 21 and can send bulk email using Gmail SMTP. I want to use Sendgrid as my smtp service so I can send larger volumes of email in a day. I created a free account to do a proof of concept. When I tried to send a single email I get the error message "My error handler overflow". I went into the VBA code for the EmailViaSMTPF and changed the user name to my business email. For email password I used the password that I set up inside of Sendgrid. Email server was sent to Smtp.Sengrid.net and SSL equal to 1. I get the error message. What am I doing wrong?
I use SendGrid myself, and they recently changed how they handle you being able to send email. You have to set up an API key on their website, and instead of a standard username and password, your username is going to be "apikey" and your password is going to be a big long string that they give you. I'll see if I can find instructions on how to do this, but they're on SendGrid's website.
To set up an API key for SendGrid's SMTP service, follow these steps:
1. Log in to your SendGrid account.
2. Navigate to the API Keys section: - Click on Settings in the left-hand navigation bar.
- Select API Keys.
3. Create a new API key: - Click on Create API Key.
- Provide a name for your API key.
- Choose the appropriate access level:
- Full Access: Grants access to all parts of your account, excluding billing and Email Address Validation.
- Restricted Access: Allows you to customize access levels for specific parts of your account.
- Billing Access: Grants access to billing endpoints.
4. Set permissions (if selecting Restricted Access): - Specify the permissions for each category as needed.
5. Finalize and store your API key: - Click Create & View.
- Copy your API key and store it securely. Note: This is the only time you'll be able to view the full API key.
6. Integrate the API key with your SMTP settings: - Set the SMTP server to `smtp.sendgrid.net`.
- Use the string `apikey` as the username.
- Use your generated API key as the password.
- Choose the appropriate port:
- For TLS: 25, 2525, or 587.
- For SSL: 465.
Thank you. Thank you. Thank you. I inserted the API key and password into vba. I still get the "MY ERROR HANDLER: Overflow." How do I fix this? See screenshot below.
Overflow is telling me that you're trying to stuff data into a container that can't hold it, like you get an overflow if you try to multiply two numbers that are integers and they come out bigger than an integer max. Have you tried sending this with just a really simple email? Maybe you're sending too much data. I don't know. I've never seen that code throw an overflow error before, and I've been using the same code for decades. Literally hundreds of people have purchased the email seminar, so it's got to be something else in your database.
Larry FisackerlyOP
@Reply 8 months ago
I rebooted computer. Sent one sentence email to my address using EmailViaSMTPF. I continue to get the overload error. I created mailing list #10 with three people on it. I sent one sentence email using TemplateF and BulkEmailF. The good news is I did not receive an overload error. The bad news is I can't find the email in the 3 email boxes that I used. The BulkEmailF indicated that it had completed the send to all three records in the mailing list each with a different address. I checked the spam folder in each of the emails. What can I be overlooking? Where do I view the sent emails? Are they in SendGrid somewhere? PS-- I do not believe I have the ability to stump Richard Ross.
That's a weird one. This is one of those problems where it's much, much easier to diagnose if I can actually play with the database. Trying to help you remotely is difficult. Uh, let's try getting rid of that record source that's a query with a WHERE condition.
Try hard-coding that to a table. Put one record in a table and see if that'll work. Does the problem happen if you just try to send a single email using just code without looping through the record set?
Sami Shamma
@Reply 8 months ago
Hi Richard,
Is it possible that the overflow is caused by a runaway loop?
Very possible. That's why I said we should isolate it first by trying to just send 1 email.
Larry FisackerlyOP
@Reply 8 months ago
I will try all of the above, but remember everything worked fine when I used Gmail's SMPT service. Does that eliminate coding errors and loops? The problem began when I switched to SendGrid today. I will switch to Gmail's SMTP tomorrow to confirm the issue is with using SendGrid.
Larry FisackerlyOP
@Reply 8 months ago
I sent bulk email using Sendgrid. Access processed the mailing list without error, however I did not receive the three emails. I then changed back to using Gmail SMTP. I sent the same three emails using bulk email. I received all three emails when using email. Although I am not a developer or programmer, the problem seems to be that thin grid receives the emails Access, But does not attend them out. It seemed like the issue lies with thin grids ability to bend the emails it receives from access. See my screenshots.
Larry FisackerlyOP
@Reply 8 months ago
Larry FisackerlyOP
@Reply 8 months ago
Larry FisackerlyOP
@Reply 8 months ago
Wow--Shame on me for not checking my voice dictation in the last post. I was successful using Gmail SMTP, but not Send Grid apikey. Looks like Access send the emails to Sendgrid, but Sendgrid is not sending them out to the recipients.
All right, check on SendGrid and make sure that you don't have email addresses that are failing or bouncing. Because SendGrid will keep a copy of all email addresses that bounce on their server. And once that happens, they'll fail any other emails that go out to that same address unless you specifically remove it from the bounce list. I've had this happen to me before.
Now I use SendGrid myself, and I'm sending out my holiday special emails right now. I've got over 50,000 emails going out between my customers and my active non-customer list. And so far, I haven't had any problems and about 60% of the batch is completed. My database runs 24/7 with almost exactly the same code that's in the email seminar. But I'll bet that's probably what the problem is with SendGrid.
Larry FisackerlyOP
@Reply 8 months ago
I am sorry. I can not figure out how to do anything in SendGrid beyond opening a free account and getting my apikey and 69 character password. I am willing to gamble on SendGrid working for me because it works for you. As such I have tried to set up a paid account thinking that would allow me to submit a SendGrid support ticket. SendGrid only offers free accounts until I exceed my initial 100 emails. I am experiencing a catch-22. PS-since I am sending test emails to myself I know the addresses are valid. Once this is resolved, it is going to be as obvious as the nose on my face. Until then my business is stalled and I am facing a December 7th deadline.
I do know that that dashboard can take 24 hours or so to update. That's not real time.
Larry FisackerlyOP
@Reply 8 months ago
Do I have to setup Domain Authentication, DNS, DKIM, ect with SendGrid? I recently went through that with another web service that will send outbound emails. Do I have to repeat those steps with SendGrid??? I have I just found the missing piece of the puzzle? One can only hope!
Yeah, pretty sure you do. I asked GPT and it said:
Yes, you generally need to set up Domain Authentication (which includes DNS records like DKIM and SPF) with SendGrid, even if you've already done so with another web service. These settings are specific to each email-sending service to ensure proper authentication for the domains you're using to send emails. Here's why and what's involved:
1. Why is it required? - Each service, such as SendGrid or another email-sending platform, requires its own DNS configuration for Domain Authentication to prove that it has permission to send emails on behalf of your domain. This improves deliverability and ensures that your emails are not marked as spam or rejected.
- Even though you may have set up DNS records (e.g., DKIM, SPF) for another service, those records are typically unique to that service and won't apply to SendGrid.
2. What you'll need to do for SendGrid: - Add SPF and DKIM Records: SendGrid will provide specific DNS records for your domain. These records need to be added to your DNS host (e.g., GoDaddy, Cloudflare).
- Set Up Domain Authentication: This process involves verifying that you own the domain and authorizing SendGrid to send emails from it.
- Optional DMARC Policy: While not always required, a DMARC policy can further protect your domain from spoofing.
3. Will you have to repeat all steps? - Yes, for SendGrid specifically, you need to generate and configure its unique DNS records. However, if you're using the same domain for both services, your existing SPF record may already include a mechanism to allow multiple services (e.g., `include:sendgrid.net` for SendGrid).
4. Practical Tip: - If your SPF record is already set up, simply ensure it includes SendGrid (e.g., `include:sendgrid.net`). You won't need to delete existing entries for other services.
- DKIM records are service-specific, so you'll need to add SendGrid's DKIM keys to your DNS.
Let me know if you'd like step-by-step guidance on how to set this up with SendGrid!
So ask ChatGPT and it will give you step by step.
Larry FisackerlyOP
@Reply 7 months ago
I have invested over 12 hours working with GoDaddy and SendGrid t/s over the holiday.
I have added records to my DNS with Godaddy. I used the Telnet SendGrid test to send emails to Gmail, Hotmail, and Twilio. SendGrid received ALL the emails I sent using Telnet.
SendGrid confirmed that my domain has been authenticated, and all headers SPF, DKIM, and DMARC have passed correctly.
I then used Access Bulk Email to send test emails to my email at my domain, Yahoo!, and Gmail. None of the emails appear on SendGrid's Activity page; none were sent to my email addresses. Please help.
Have you tried running Fiddler or WireShark to see the requests being made?
Larry FisackerlyOP
@Reply 7 months ago
Sendgrid is saying that since the Telnet test was successful there is no problem with SendGrid, and of course they do not support 3rd party applications such as Microsoft Access. in other words SendGrid has washed their hands. They recommended that I use TLS rather than SSL. Their first choice of ports with TLS is 587. How do I configure Access bulk email to use TLS rather than SSL? I can see that SSL is specified in two places in the VBA. PS--Richard I do appreciate you feelings about GoDaddy. Remember, Bulk Email works with Gmail SMTP server using GoDaddy, it just doesn't work with SendGrid SMTP server. Alex I probably not qualified to use Fiddler or WireShark. Over my head.
Larry FisackerlyOP
@Reply 7 months ago
Progress--I changed to TLS with port 587 in the Global Passwords code and Bulk Email sent to my Yahoo! and Gmail personal emails. My business domain email (with the dreaded GoDaddy) did not receive the Bulk Email. What change do I make to the Msg.Configuration...entry? See screenshots.
Larry FisackerlyOP
@Reply 7 months ago
Larry FisackerlyOP
@Reply 7 months ago
Larry FisackerlyOP
@Reply 7 months ago
I am heavily invested in Office 365 and like Microsoft Exchange for email. What do you recommend in place of GoDaddy?
Sami Shamma
@Reply 7 months ago
WinHost are great. I picked them on Richard's recommendation. They are truly remarkable.
Larry FisackerlyOP
@Reply 7 months ago
Success! I can send emails from Access Bulk Email using SendGrid SMTP server. Lesson earned'I must use TLS (NOT SSL) in the EmailPasswords Module. It took me 3 weeks to figure that out. On the bright side there were no typos in my code. How do I specify TLS in the VBA code? See screenshot.
I've been using Sendgrid with Microsoft Access for literally a decade, and I have never had to use TLS. I'm just using straight SMTP with an API key and port 465. However, a quick query of GPT gives me this:
In Microsoft Access VBA, when sending an email via SMTP using CDO, you need to set the appropriate configuration fields to enable TLS instead of SSL. TLS is often referred to as "STARTTLS" in SMTP configurations. Below is an example configuration for enabling TLS:
CodeSub SendEmailWithTLS()
Dim objMessage As Object
Dim objConfig As Object
Dim Fields As Object
' Create the email object
Set objMessage = CreateObject("CDO.Message")
Set objConfig = CreateObject("CDO.Configuration")
Set Fields = objConfig.Fields
' Configure the SMTP server settings
With Fields
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.example.com" ' Replace with your SMTP server
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 587 ' Port for TLS
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 ' cdoSendUsingPort
.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 ' Basic Authentication
.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "your_username" ' Your email username
.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "your_password" ' Your email password
.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False ' Disable SSL
.Item("http://schemas.microsoft.com/cdo/configuration/smtpusetls") = True ' Enable TLS
.Update
End With
' Configure the email message
With objMessage
Set .Configuration = objConfig
.To = "[email protected]" ' Replace with recipient email
.From = "[email protected]" ' Replace with sender email
.Subject = "Test Email with TLS"
.TextBody = "This is a test email sent using TLS."
.Send
End With
' Clean up
Set objMessage = Nothing
Set objConfig = Nothing
Set Fields = Nothing
MsgBox "Email sent successfully using TLS."
End Sub
Key Points: 1. TLS Port: Port `587` is typically used for TLS. Ensure your SMTP server supports this port.
2. Disable SSL: The `.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl")` property should be set to `False` for TLS.
3. Enable TLS: Use `.Item("http://schemas.microsoft.com/cdo/configuration/smtpusetls") = True` to explicitly enable TLS.
If your email provider does not specifically require `.smtpusetls`, using port `587` with `.smtpusessl = True` often negotiates TLS automatically. Ensure the server supports the protocol and authentication method you are trying to use.
Larry FisackerlyOP
@Reply 7 months ago
You are absolutely amazing! Give me a while to digest your wisdom. I figured I might be wrong about TLS being required, but it did word when I changed. I will try to implement what you said. Thanks so much!
Sorry, only students may add comments.
Click here for more
information on how you can set up an account.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Email Seminar Lessons.
The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.