Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Can no longer email from Access
Mark Budinger 
     
4 years ago
At my job we have 5 computers, 4 Windows 10 Pro and 1 Windows 11 Pro. All are using the same version and build of Microsoft Office 2016 Professional. All the machines with Windows 10 and Outlook as the default email are able to send reports via email in access. The one windows 11 machine can no longer do this. I get the error "Microsoft can't send this email message" This feature is really needed with our database. So I am wondering if anyone else has had this issue. I went into windows 11 settings and set outlook as the default app for basically everything. I also rebooted the computer and it still won't work. Any help would be greatly appreciated.

Regards,
Mark
Richard Rost  @Reply  
          
4 years ago
Update your windows defender virus scanner
Mark Budinger OP  @Reply  
     
4 years ago
Hi Richard,

I don't use windows defender for my virus scanner, but I enabled, updated it, and restarted the computer and it still won't work. I did notice my Windows 10 machines had an extra program installed "microsoft access database engine 2010" So I installed that on my Windows 11 machine and it still gives me the same error. When I go to the form that is using VB to do this DoCmd.SendObject, I end up with a 2239 error and it points to the line error with the DoCmd.SendObject code.  Also, my main antivirus program is fully up to date and I even disabled email protection and I still get the same error.
Richard Rost  @Reply  
          
4 years ago
Run down the Troubleshooter. 599cd.com/trouble
Mark Budinger OP  @Reply  
     
4 years ago
Hi Richard,

I did check the troubleshoot section and the database seems fine. All my windows 10 machines are having no issues. I crested a while new table and form and report and I still get the same problem. Used new table, firm, and report on the windows  10 machines and it works fine. Both have same references as well.

Regards,
Mark
Kevin Robertson  @Reply  
          
4 years ago
Would your Firewall settings in Windows 11 be causing a problem?
Mark Budinger OP  @Reply  
     
4 years ago
Hi Kevin,

I have tried that. I disabled my anti virus and firewall with same error.
Kevin Yip  @Reply  
     
4 years ago
Hi Mark, if you have SendObject's EditMessage option set to False, set it back to True (which is the default).  SendObject should then open up the email composition window of the email you just composed, with the attachment and everything.  See if anything is amiss (maybe sender's or recipient's email address is wrong), and click Send.  If the email goes through, setting EditMessage back to False should work too.
Richard Rost  @Reply  
          
4 years ago
Good idea
Mark Budinger OP  @Reply  
     
4 years ago
Hi Kevin,

This is the VB I am using that is working on all windows 10 machines but not the windows 11.


10        On Error GoTo cmdEMail_Click_Error
      Dim strDocname As String
      Dim strWhere As String
      Dim strToWhom As String
      Dim strMsgBody As String
      Dim strSubject As String
      Dim strPath As String
          

20    strDocname = "Vendor_Orders"
'30    strWhere = "[CustomerID]= " & Me.CustomerID
40    strSubject = "New Order"
50    strToWhom = Me.EMail
60    strMsgBody = "Find attached a new Order."

70    If Me.Dirty Then Me.Dirty = False ' force a save

80    MsgBox "A copy of the Order will be saved to the Server", vbInformation

90    strPath = "R:\Shop\Material-Orders\" & Format(DATE, "yyyymmdd") & "-" & Format(Time, "hhmmss") & "-" & [CUST_CODE] & ".pdf"
'90     strPath = "Z:\Shop\Material-Orders\test\" & Format(Now(), "yyyymmdd hhnnss") & " - " & [CUST_CODE] & ".pdf"

100   DoCmd.OpenReport strDocname, acPreview, , , acWindowNormal
110   DoCmd.OutputTo acOutputReport, strDocname, acFormatPDF, "R:\Shop\Material-Orders\" & Format(DATE, "yyyymmdd") & "-" & Format(Time, "hhmmss") & "-" & [CUST_CODE] & ".pdf", False
'110   DoCmd.OutputTo acOutputReport, strDocname, acFormatPDF, "Z:\Shop\Material-Orders\test\" & Format(Now(), "yyyymmdd hhnnss") & " - " & [CUST_CODE] & ".pdf", False


120   DoCmd.SendObject acSendReport, "Vendor_Orders", acFormatPDF, strToWhom, , , strSubject, strMsgBody, True

          
130       On Error GoTo 0
140       Exit Sub

cmdEMail_Click_Error:

150       MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure cmdEMail_Click, line " & Erl & "."
Kevin Yip  @Reply  
     
4 years ago
Hi Mark, remove the On Error statement and see how the actual run-time error plays out.  If any of the statements before SendObject causes errors, resulting in, say, a bad report, bad PDF, etc., then SendObject can't run and of course will cause an error too.  Yes, I know you say it works in Windows 10.  But you are running this on a different machine too, so everything may not be identical.  But this ends up really Win11-related, then sadly I've never used Win11 myself so I won't be of help at that point.
Kevin Yip  @Reply  
     
4 years ago
You can alternatively use the "Outlook" object in VBA to send emails, which I suspect should work in Windows 11.  I never use SendObject because it uses your default mail client, which may not be Outlook.  (My default email client is Thunderbird.).  I think Richard has a video on the Outlook object.  Sample VBA code:

    ' Create a new MailItem.
    Dim m As Outlook.MailItem
    Set m = Outlook.Application.CreateItem(Outlook.OlItemType.olMailItem)
    
    m.Subject = "test sending attachments"
    m.Body = "Hello World" & vbCr & vbCr

    ' Recipient's e-mail address.
    m.To = "a_friend@whom_i_trust.com"

    ' Create attachment
    Dim a As Outlook.Attachments
    Set a = m.Attachments
            
    ' Attach attachments to email.
    a.Add "C:\My Documents\report1.pdf"
    a.Add "C:\My Documents\report2.pdf"

    ' Send email.
    m.Send

Mark Budinger OP  @Reply  
     
4 years ago
Hi Kevin,

When I use the my existing VB I get the 2239 error and it points to line 120

120   DoCmd.SendObject acSendReport, "Vendor_Orders", acFormatPDF, strToWhom, , , strSubject, strMsgBody, True

it saving as a PDF to our network share is working just fine. Outlook is the only email client I use at work so it is set as my default. Just wanted to let you know. I am still new with Access, if it wasn't for Richard and his channel I wouldn't have gotten this far. On another forum someone helped me with the VB for emailing so I am still a new to all of this.
Kevin Robertson  @Reply  
          
4 years ago
I recommend the Access Email Seminar. Richard teaches everything you could possibly need to know about sending Email in Access.
Mark Budinger OP  @Reply  
     
4 years ago
I was looking at that but I can't afford that right now and my boss won't approve the purchase either. For now I will just deal with it not working on the windows 11 machine. As long as my foreman can still using it on his desktop and we will make sure not to upgrade that computer.  Thanks for all the help.
Kevin Yip  @Reply  
     
4 years ago
Hi Mark, is the error 2293 instead of 2239?

Your next step would be to try using the Outlook object as shown in my sample code.  No matter the differences in Window versions and/or PC configurations, the Outlook object should always work.
Mark Budinger OP  @Reply  
     
4 years ago
Hi Kevin,

Yes the error is 2293 (Microsoft Access can't send this e-mail message.) in procedure cmdEmail_Click, line 120) sorry my dyslexia kicked in. I will try and use the code you suggested and see how to use it with my existing VB.
Mark Budinger OP  @Reply  
     
4 years ago
Hi Kevin,

Thank you for the VB suggestion. I have tested it out and it seems to be working on the win 11 machine. I do have question. Is there a way that once the email message pops up for us to send, is there a way that the cursor appears at the end of the body text and not before it? Or is this just the standard and we have to deal with it?

Thank you and Richard for all the help.

Regards,
Mark
Richard Rost  @Reply  
          
4 years ago
Moving the cursor - it may be possible, but that will be tricky to code. You're better off composing the entire email message in Access first, then sending it.
Kevin Yip  @Reply  
     
4 years ago
This is one instance where the SendKeys command may be useful.  You press Ctrl-End to put the cursor at the end of a page.  So the command would be:

SendKeys "^+{END}{RIGHT}"

I normally don't use SendKeys because it may behave unpredictably.  And Richard puts it on his "Evil Access Stuff" list.  I have to add {RIGHT} just to make sure the cursor works as it should, which is silly.  Mark, my advice is just press Ctrl-End on the keyboard yourself.
Mark Budinger OP  @Reply  
     
4 years ago
Hi Kevin,

I will take your advice and teach my bosses the Ctrl-End keyboard shortcut. My database is a huge mess from when it was created back in 2000. Watching Richard's beginner courses, I realized all of our tables are made wrong and causing so many issues. We were going to pay a company to do our database properly but the money they wanted was crazy and now I understand why.

I want to thank you and Richard again for all the help.

Regards,
Mark

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/2/2026 8:30:41 AM. PLT: 1s