Schdule Bulk email with attachment using excel VBA (Outlook)

avisoft20

Board Regular
Joined
Sep 10, 2016
Messages
63
Dear All,
I want to send email with attachment using VBA.i am using this code sending an email using excel through outlook,its working but there is any possibility to insert a schedule time to deliver mail.here is the code.
i want to deliver mail on a particular time that is provided by my senior.



Sub Button1_Click()
email
End Sub
Public Function email()
Dim fnum As Integer
Dim lnum As Integer
lnum = 75
Dim tt1 As String
Dim tt2 As String


For fnum = 1 To lnum
tt1 = "b" & fnum
tt2 = "a" & fnum
tt3 = "c" & fnum
tt4 = "d" & fnum
' tt5 = "e" & fnum
' tt6 = "f" & fnum

esub = Range(tt4).Value
sendto = Range(tt1).Value
fname = Range(tt2).Value
'fname1 = Range(tt5).Value
'fname2 = Range(tt6).Value
cc = Range(tt3).Value
'bcc = Range(tt6).Value
Set app = CreateObject("Outlook.Application")
Set itm = app.createitem(0)
With itm
.Subject = esub
.to = sendto
.cc = cc
.attachments.Add (fname)
'.attachments.Add (fname1)
'.attachments.Add (fname2)
'.bcc = bcc
.display
.send
End With
Set app = Nothing
Set itm = Nothing




Next fnum


End Function

-----------
Thanx & regards:
avisoft20
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Code:
  itm.DeferredDeliveryTime = Date + TimeSerial(17, 0, 0) ' set delivery to 5 PM today
  itm.DeferredDeliveryTime = Now() + TimeValue("0:10") ' set delivery 10 minutes from now
 
Upvote 0
Thanx for your reply.
can u put into my vba .
Code:
  itm.DeferredDeliveryTime = Date + TimeSerial(17, 0, 0) ' set delivery to 5 PM today
  itm.DeferredDeliveryTime = Now() + TimeValue("0:10") ' set delivery 10 minutes from now
 
Upvote 0

Forum statistics

Threads
1,215,063
Messages
6,122,935
Members
449,094
Latest member
teemeren

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