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
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

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
 

Forum statistics

Threads
1,141,220
Messages
5,705,091
Members
421,378
Latest member
CarlosDuran

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top