Here is the VBA code to send emails from Outlook:
Sub SendEmails()
Dim OlApp As Object
Dim OlMail As Object
Set OlApp = CreateObject("Outlook.Application")
Set OlMail = OlApp.CreateItem(olMailItem)
With OlMail
.Display
.To = "aaa@gmail.com"
.CC = "bbb@gmail.com"
.Subject = "Test Email"
.Attachments.Add "C:\Test.xlsx"
.Body = "Test email"
.Save
.Close olPromtForSave
.Send
End With
End Sub
Sub SendEmails()
Dim OlApp As Object
Dim OlMail As Object
Set OlApp = CreateObject("Outlook.Application")
Set OlMail = OlApp.CreateItem(olMailItem)
With OlMail
.Display
.To = "aaa@gmail.com"
.CC = "bbb@gmail.com"
.Subject = "Test Email"
.Attachments.Add "C:\Test.xlsx"
.Body = "Test email"
.Save
.Close olPromtForSave
.Send
End With
End Sub