Outlook Coding - Select different email adresses to send from

  • Thread starter Thread starter William McIlroy
  • Start date Start date
Status
Not open for further replies.
W

William McIlroy

I have code to send emails progamtically from a module in Excel 2000 using OUtlook 2000, but now I need to have the code select 1 of 5 different email addresses and potentially a different mail server. Any ideas?

-Set NewMail = CreateObject("Outlook.Application")

Set objmail = NewMail.CreateItem(olMailItem)

With objmail

> To = Email

> Subject = "Quotes for " & Name

> Body = emailtext

> Send

End With

Set NewMail = Nothing

Set objmail = Nothing

----------------------------------
 
Setting the send account isn't supported before Outlook 2007. With

Redemption (www.dimastr.com) that's possible.

Best regards

Michael Bauer

Am Sat, 09 Jan 2010 04:35:31 -0800 schrieb William McIlroy:


> I have code to send emails progamtically from a module in Excel 2000 using


OUtlook 2000, but now I need to have the code select 1 of 5 different email

addresses and potentially a different mail server. Any ideas?

> -> Set NewMail = CreateObject("Outlook.Application")
> Set objmail = NewMail.CreateItem(olMailItem)
> With objmail
> .To = Email
> .Subject = "Quotes for " & Name
> .Body = emailtext
> .Send

> End With

> Set NewMail = Nothing
> Set objmail = Nothing

> -->
 
Thanks Michael - quick question though. What is Redemption? Is there a cost associated with it?
 
One other thought - what would the code be if I upgrade to Office 2007?
 
In OL07 you can access all the available accounts through the

Application.Session.Accounts collection. And you can set the

MailItem.SendUsingAccount property to a certain account.

Best regards

Michael Bauer

>
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
G Outlook 2010 VBA Coding Assistance please! Outlook VBA and Custom Forms 5
Z Outlook account subfolders - Outlook VB coding Using Outlook 8
F Color Coding Emails - Outlook 2007 SP-3 Using Outlook 1
B Outlook or iPhone turning tabs into spaces in Outlook Notes Using Outlook 0
P newly installed Office 365 includes OLD Outlook Using Outlook 6
R Outlook ribbon menu default? Using Outlook 7
H Spam email in Gmail not visible in Outlook Using Outlook 3
J How to transfer Win 10 Outlook to new Windows 11 pc? Using Outlook 9
J Renegade spam URL line displayed in old local Outlook 365 email title Using Outlook 3
G Reduce whitespace in Outlook desktop Contact Cards display Using Outlook 3
C Outlook classic via 365 Using Outlook 2
Dr. Demento Analogous Outlook code to read info into an array (or collection or whatever) Outlook VBA and Custom Forms 7
S Repair Outlook Using Outlook 8
V Outlook Form ListBox is not editable Outlook VBA and Custom Forms 2
F Outlook's contacts Using Outlook 1
D Outlook 2003 stopped dead Using Outlook 2
G Cannot receive emails from gmail account in Outlook 365 Using Outlook 1
E "Cannot display the folder. MS Outlook cannot access the specified file location" Using Outlook 8
P Outlook 2016 Working Offline Using Outlook 2
Rupert Dragwater Cannot reestablish gmail (email address) account in Outlook 365 Using Outlook 11
O Outlook 365 synchronisieren Exchange Server Administration 1
kburrows Outlook Classic - JPG files are corrupted when opened or saved Using Outlook 3
F Sync Outlook Calendar Using Outlook 0
G Change default font size in sticky notes - Outlook Desktop 2021 Using Outlook 2
C VBA in "New Outlook?" Using Outlook 0
D New Outlook with Business Basic Plans Using Outlook 0
D Outlook 2021 not working with Outlook 2003 installed Using Outlook 5
D Outlook 2003 stopped working - get they dialog box asking for username & Password Using Outlook 2
T Outlook 2021 hangs in close on taskbar occasionally Using Outlook 1
M Duplicate removal feature in Outlook 2021 is faulty Using Outlook 2
D.Moore Outlook COM addins source folder Using Outlook 12
P Removing Outlook 365 Account from Send/Receive Using Outlook 3
kburrows Outlook Automatically Merging Contacts Using Outlook 2
A Outlook 2016 Outlook 2016 vs. New Outlook Using Outlook 4
D Outlook Desktop App Email Software Using Outlook 0
efire9207 VBA Outlook Contacts Outlook VBA and Custom Forms 6
M Outlook not logging in to server Using Outlook 0
J Outlook macro to run before email is being send Outlook VBA and Custom Forms 3
R Outlook 2021 change view Using Outlook 2
K Outlook font corrupted in some point sizes, resets on close/open Using Outlook 2
J Is the Windows Outlook Tasks module really going to be gone? Using Outlook 6
F Outlook 2010 and Hotmail Using Outlook 1
A Outlook 2021 needs 'enter' for people search Using Outlook 2
HarvMan Outlook 365 Inbox Font Using Outlook 8
Retired Geek Outlook on MAC delete duplicate Sent emails Using Outlook 0
S New Outlook - IMAP ISSUES and support for addins? Using Outlook 1
C outlook.com fonts Using Outlook 2
R Outlook with several IMAP accounts generating folders with 1111 suffix Using Outlook 0
D Send email from Outlook Alias using Mac? Using Outlook 0
G Reply a selected message and remove blank space before signature Outlook 365 version 2406 64BIT Outlook VBA and Custom Forms 2

Similar threads

Back
Top