Outlook Coding - Select different email adresses to send from

  • Thread starter William McIlroy
  • Start date
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

----------------------------------


Submitted via EggHeadCafe - Software Developer Portal of Choice
Uploading & Downloading Files using ASP.NET
http://www.eggheadcafe.com/tutorial...cd-7cc6fc1980a4/uploading--downloading-f.aspx
 
M

Michael Bauer [MVP - Outlook]

Setting the send account isn't supported before Outlook 2007. With
Redemption (www.dimastr.com) that's possible.

--
Best regards
Michael Bauer - MVP Outlook
Manage and share your categories:
<http://www.vboffice.net/product.html?pub=6&lang=en>


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

----------------------------------


Submitted via EggHeadCafe - Software Developer Portal of Choice
Uploading & Downloading Files using ASP.NET
http://www.eggheadcafe.com/tutorial...cd-7cc6fc1980a4/uploading--downloading-f.aspx
 
B

Bill

Thanks Michael - quick question though. What is Redemption? Is there a cost associated with it?
 
M

Michael Bauer [MVP - Outlook]

M

Michael Bauer [MVP - Outlook]

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 - MVP Outlook
Manage and share your categories:
<http://www.vboffice.net/product.html?pub=6&lang=en>



Am Sat, 09 Jan 2010 05:17:08 -0800 schrieb bmcilroy:
One other thought - what would the code be if I upgrade to Office 2007?
http://msgroups.net/microsoft.publi...-Select-different-email-adresses-to-send-from
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top