Sending a group e-mail

jenrique.cerda

Board Regular
Joined
Sep 22, 2006
Messages
53
Hi, I now know how to send a personalized e-mail. I know this but this sends one e-mail to each person instead of sending one e-mail to lots of them... can anyone help me to send just one e-mail?

The code for this is:

Sub SendEmail()
Dim OutlookApp As Object
Dim MItem As Object
Dim cell As Range
Dim Subj As String
Dim EmailAddr As String
Dim Recipient As String
Dim Bonus As String
Dim Msg As String

'Create Outlook object
Set OutlookApp = CreateObject("Outlook.Application")

'Loop through the rows
For Each cell In Columns("B").Cells.SpecialCells(xlCellTypeConstants)
If cell.Value Like "*@*" Then
'Get the data
Subj = "Your Annual Bonus"
Recipient = cell.Offset(0, -1).Value
EmailAddr = cell.Value
Bonus = Format(cell.Offset(0, 1).Value, "$0,000.")

'Compose message
Msg = "Dear " & Recipient & vbCrLf & vbCrLf
Msg = Msg & "I am pleased to inform you that "
Msg = Msg & "your annual bonus is "
Msg = Msg & Bonus & vbCrLf & vbCrLf
Msg = Msg & "William Rose" & vbCrLf
Msg = Msg & "President"

'Create Mail Item and send it
Set MItem = OutlookApp.CreateItem(0)
With MItem
.To = EmailAddr
.Subject = Subj
.Body = Msg
.Display
'NOTE: To actually send the emails, use .Send instead of .Display
'.Send
End With
End If
Next
End Sub
 

Some videos you may like

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)

oddworld

Board Regular
Joined
May 31, 2005
Messages
248
re

Hi there i use the following to sent off standard reports to our webmaster each month, i have a number of buttons setup on a spraed sheet, once i have updated all my spreadsheets, i send different sheets out to different people.



Private Sub CommandButton1_Click()
Dim OutApp As Object
Dim OutMail As Object
Dim wb As Workbook

Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
With OutMail
.To = "web.master@hotmail.com"
.CC = "theboss@dhotmail.com"
.BCC = ""
.Subject = "Monthly Web Update"
.Body = "Hi webmaster can you please publish our latest products on the web as attached, Regards, me "
.Attachments.Add ("G:\dgpp\dwpe\dwp-a\Trade Management\Ara\OR\OR PROFILE files\OR PROFILE.xls")
.Attachments.Add ("G:\dgpp\dwpe\dwp-a\Trade Management\Ara\Officer\Officer Profile.xls")
.Attachments.Add ("G:\dgpp\dwpe\dwp-a\Reports\Out\Manning Sitrep 03-04.xls")
.Attachments.Add ("G:\dgpp\dwpe\dwp-a\Reports\Out\Army Personnel Indicators\Persindicators.xls")
.Attachments.Add ("G:\dgpp\dwpe\dwp-a\Reports\Out\Army Personnel Indicators\Army Personnel Indicators Current.xls")
'You can add other files also like this
'You can add other files also like this
'.Attachments.Add ("C:\whatever\document.doc")
.Send 'or use .Display

End With
Application.ScreenUpdating = True
Set OutMail = Nothing
Set OutApp = Nothing
End Sub

CHEERS ODD
 

Watch MrExcel Video

Forum statistics

Threads
1,108,954
Messages
5,525,879
Members
409,669
Latest member
JDCupps

This Week's Hot Topics

Top