Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   Templates   Seminars   TechHelp   Forums   Help   Contact   Join   Order   Logon  
 
Home > TechHelp > Directory > Access > Send Email < Multi-Field Find | Import Excel >
Back to Send Email    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Multiple Email Accounts
Jean-Pierre Christen 
     
22 months ago
Hi Richard!

I really enjoyed the video, especially sending mass emails with a Recordset Loop (watching the StatusBox zoom through emails is especially satisfying!)

In the GlobalMod, there is TO, CC and BCC. Is there a FROM option? I have 3 email accounts in Outlook, and I would like to select in VBA which account the emails will be sent from.

I tried adding the following in the VBA
SenderEmailAddress = [email protected]
SendUsingAccount = [email protected]

But I only get error messages.

Is there a way to make this work?

With Best Regards,
JP
Jennifer Neighbors  @Reply  
     
22 months ago
You can indicate which email account to send from, Jean-Pierre, as long as the account you use is a valid Outlook email account. (This works when using Outlook for sending emails.)

Dim oOutlook As Object, oOutlookAccount As Object
Dim varAccount as Variant

If Not IsNull(Me.FromEmailAddress) And Me.FromEmailAddress <> "" Then
        varAccount = Me.FromEmailAddress
        For Each oOutlookAccount In oOutlook.Session.Accounts
               If oOutlookAccount = varAccount Then
                     Set .SendUsingAccount = oOutlookAccount
               End If
         Next
End If

When sending batch emails, I use this code inside my send loop. The "Me.FromEmailAddress" item is a form field containing the email address to send from. This code will throw an error if it's not previously set up as a valid Outlook email account.

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

Next Unseen

 
 
 

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 2025 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 11/18/2025 12:29:07 AM. PLT: 1s