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

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.

Keiser

New Member
Joined
May 29, 2002
Messages
29
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.
 

dk

MrExcel MVP
Joined
Feb 15, 2002
Messages
2,942
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
 

DonkeyOte

MrExcel MVP
Joined
Sep 6, 2002
Messages
9,123
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
 

Forum statistics

Threads
1,144,221
Messages
5,723,102
Members
422,477
Latest member
pete101

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