Sending an email within MS Access app

Norman Smith 0 Reputation points
2025-09-14T13:50:56.13+00:00

Hi, does anyone have any sample code to send an email from an icloud.com email address from within a MS Access published database?

I am using Access 2024.

Thank you.

Microsoft 365 and Office | Access | For home | Other
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Dora-T 8,600 Reputation points Microsoft External Staff Moderator
    2025-09-15T00:59:16.1266667+00:00

    Hi @Norman Smith

    Thank you for reaching out to the Microsoft Q&A Forum. 

    Based on your question, I tried this in my own Access 2024 environment. In my test, I was able to send from an iCloud address by signing into iCloud in Outlook first and then using Access to call Outlook to send the message. Here’s the sample I used, which you might find helpful as a reference, and you can adjust it for your setup if needed: 

    Sub SendEmailViaOutlook() 
        Dim OutApp As Object 
        Dim OutMail As Object 
        Set OutApp = CreateObject("Outlook.Application") 
        Set OutMail = OutApp.CreateItem(0) 
         With OutMail 
            .To = "someone@example.com" 
            .Subject = "Test Email from Access via Outlook" 
            .Body = "This is a test email sent from Access using Outlook with an iCloud account." 
            .Send 
        End With 
         MsgBox "Email sent successfully", vbInformation 
    End Sub
    

    Please note that I don’t have the same published environment as you, so this was only tested in Access 2024 on my side. 

    If two-factor authentication is enabled on your Apple ID, you may need to generate an app-specific password. Also, this approach relies on Outlook already being set up with your iCloud account so the database code can pass the message through Outlook. 

    I hope this points you in the right direction.


    If the answer is partially helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".     

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.