Email

3d

Board Regular
Joined
May 23, 2002
Messages
86
Now I have searched and found the script that I require for sending an email but I have a little quest about it

Sub SendIt()
Application.Dialogs(xlDialogSendMail).Show _
arg1:="bloggs@anywhere.com", _
arg2:="This goes in the subject line"
End Sub

but if I want to send it to multiple people do I make the script like this?

Sub SendIt()
Application.Dialogs(xlDialogSendMail).Show _
arg1:="bloggs@anywhere.com; someone@somewhere.com", _
arg2:="This goes in the subject line"
End Sub

I have tried this but although it shows it in the line of the send to in the email proggie it only sends to the first person and not the 2nd can I have a pointer please

thanx in advance

_________________
This message was edited by 3d on 2002-11-05 06:50
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
A shoot in the dark :wink:

If you are using some mailing program, how about making a mail group (if the recipients are constant) and use the groups name in the argument.

And then the hype.

write the recipients in the argument like so:
"who@where.com" & ";" & "what@none.org"
thus combining strings (perhaps try other versions of this method!!!)

hope this does more good than bad

Keiser.
 
Upvote 0
How about :-

Code:
Sub SendIt()
Application.Dialogs(xlDialogSendMail).Show _
arg1:=Array("bloggs@anywhere.com", "someone@somewhere.com"), _
arg2:="This goes in the subject line"
End Sub
 
Upvote 0
As per someone else - create a mail group (easier to amend)

This uses a loop through files and mail groups - range A1:A15 & B1:B15 respectively.

This needs Outlook 9.0 Object Library Referenced and also DAO 3.6 Object Library.

Have outlook open when you run it.

If it helps...

Private Sub CommandButton1_Click()


Dim aOutlook As Outlook.Application, aEmail As Outlook.MailItem
CRLF = Chr(10) & Chr(13)

Application.ScreenUpdating = False

DATA = Sheets("sheet1").Range("A1:A15")
CROW = 1

Set aOutlook = GetObject(, "Outlook.Application")

DATA = Sheets("sheet1").Range("A1:A15")
CROW = 1

For Each MAILFILE In DATA

Set aEmail = aOutlook.CreateItem(olmailitem)

aEmail.Subject = "Daily " & MAILFILE & " for your perusal."

aEmail.Body = "Please find attached the " & MAILFILE & " for today." & CRLF & CRLF

aEmail.Recipients.Add Sheets("sheet1").Range("B" & CROW)

aEmail.ATTACHMENTS.Add ("j:misellaneousutrustpricingut mail attachments" & MAILFILE)

aEmail.Send

CROW = CROW + 1

Next MAILFILE

MsgBox "Emails successfully sent."



End Sub
 
Upvote 0

Forum statistics

Threads
1,214,561
Messages
6,120,245
Members
448,952
Latest member
kjurney

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
Back
Top