Send email with vba in 30 days

Jerrbear

New Member
Joined
Jan 16, 2018
Messages
5
I need a thread to send an email out with in 30 days of a date to remind of a due date using macros. Need help please. I have the email set up just need the 30 days

This is what I have and it works, I just need to add 30 day string. Is this possible???

private Sub CommandButton7_Click()

Dim outApp As Object
Dim outMail As Object
Dim Strbody As String

Set outApp = CreateObject("outlook.Application")
Set outMail = outApp.CreateItem(0)

Strbody = "Email."
On Error Resume Next
With outMail
.to = "@@@@"
.Subject = "Email "
.Body = Strbody
.send

End With
On Error GoTo 0
Set outMail = Nothing
Set outApp = Nothing
End Sub
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
'Stay in the outbox untill this date and time
.DeferredDeliveryTime = "1/6/2007 10:40:00 AM"

'Wait four hours
.DeferredDeliveryTime = DateAdd("h", 4, Now)

'in 30 days
.DeferredDeliveryTime = DateAdd("d", 30, Now)
 
Last edited:
Upvote 0
That is not working for me. I have dates in a cell and when 30 day gets by from a purchase then I need to send a email out. Is there another way.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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