Forum

How to send an emai...
 
Notifications
Clear all

How to send an email at specific time based on dates in excel?

4 Posts
2 Users
0 Reactions
49 Views
(@tinak)
Posts: 39
Trusted Member
Topic starter
 

I want to send send an email at the specific time of a day in Excel, if the workbook is closed, the macro still runs to pop up an email so I can click "send" after making some changes.

please see the attached file containing the code I found online, unfortunately it is not working at set time. 

Can anyone shed some light and help?

many thanks!

 
Posted : 03/02/2021 9:23 pm
(@catalinb)
Posts: 1937
Member Admin
 

Hi Tina,
The line that sends the email is disabled:
'.Send

Remove the apostrophy and will work

 
Posted : 05/02/2021 12:44 am
(@tinak)
Posts: 39
Trusted Member
Topic starter
 

I have updated the code as you suggested, 

Sub SendEmail()

Set olApp = CreateObject("Outlook.application")
Set objMail = olApp.CreateItem(olMailItem)
With objMail
.Display
.To = "[email protected]"
.Subject = "reminder"
'HTML for fun
'.BodyFormat = olFormatHTML
.HTMLBody = "<HTML><H2>Please review your request and submit again.</BODY></HTML>"
.Send

End With
End Sub

But it doesn't generate an email at set time. and when I open the file and run macro, the email was sent straightaway. I am hoping to have an email pop up first so I can modify the body message before sending it. Any suggestion?

Thanks again!

 
Posted : 05/02/2021 9:09 pm
(@catalinb)
Posts: 1937
Member Admin
 

Instead of .Send, use .Display to see the email.

 
Posted : 06/02/2021 12:28 am
Share: