Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
SD SD is offline
external usenet poster
 
Posts: 24
Default Sending multiple emails at same time in Excel

I have this code below that sends an email using outlook 2003 to a list of
email addresses I have referenced elsewhere in excel row by row. The trouble
I have is it sends the email sperately to each person on that list one by one
rather than sending it to them all together. How can I change this. Thanks.
Code is below.

Function emailMethod(EMailSendTo$, EMailSubject$, EMailAttachment$)
' Sending emails with Outlook

Dim objOutlook As Object
Dim objMailMessage As Outlook.MailItem
Dim emlBody, sendTo As String
Dim wkbook As String


Application.ScreenUpdating = False

Set objOutlook = CreateObject("Outlook.Application")
Set objMailMessage = objOutlook.CreateItem(0)
sendTo = EMailSendTo
wkbook = EMailAttachment

With objMailMessage
..To = ""
..BCC = sendTo
..Subject = EMailSubject
..Attachments.Add wkbook, olByValue
..Display


Application.Wait (Now + TimeValue("0:00:01"))
Application.ScreenUpdating = False

Application.SendKeys "%S"
Application.ScreenUpdating = False


End With
Set objOutlook = Nothing
Set objMailMessage = Nothing


Exit Function

End Function
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Sending multiple emails at same time in Excel

See my mail page
http://www.rondebruin.nl/sendmail.htm

And look on the Tip page
http://www.rondebruin.nl/mail/tips2.htm


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"SD" wrote in message ...
I have this code below that sends an email using outlook 2003 to a list of
email addresses I have referenced elsewhere in excel row by row. The trouble
I have is it sends the email sperately to each person on that list one by one
rather than sending it to them all together. How can I change this. Thanks.
Code is below.

Function emailMethod(EMailSendTo$, EMailSubject$, EMailAttachment$)
' Sending emails with Outlook

Dim objOutlook As Object
Dim objMailMessage As Outlook.MailItem
Dim emlBody, sendTo As String
Dim wkbook As String


Application.ScreenUpdating = False

Set objOutlook = CreateObject("Outlook.Application")
Set objMailMessage = objOutlook.CreateItem(0)
sendTo = EMailSendTo
wkbook = EMailAttachment

With objMailMessage
.To = ""
.BCC = sendTo
.Subject = EMailSubject
.Attachments.Add wkbook, olByValue
.Display


Application.Wait (Now + TimeValue("0:00:01"))
Application.ScreenUpdating = False

Application.SendKeys "%S"
Application.ScreenUpdating = False


End With
Set objOutlook = Nothing
Set objMailMessage = Nothing


Exit Function

End Function

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sending multiple EMails thru excel? Bigredno8 Excel Discussion (Misc queries) 2 October 27th 05 10:37 AM
Help Sending Emails From Excel mrk0 Excel Discussion (Misc queries) 1 July 6th 05 06:42 PM
Sending multiple emails using SendMail Fiona Nelson Excel Programming 2 July 13th 04 04:47 PM
Avoiding Run-Time errors when sending emails from Excel BruceJ[_2_] Excel Programming 1 November 10th 03 06:27 PM


All times are GMT +1. The time now is 04:57 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"