HI everybody.
I am using the code below to send e-mails using vba. What the macro is doing is; take the contact form one excel sheet and send an e-mail to all of them.
My idea is to use an e-mail as a reference so I can reply to this e-mail using the contact on the e-mail (TO and CC contact).
Any ideas?
Sub SendEmail(contact As String, subject As String, body As String)
Dim app As Outlook.Application
Set app = CreateObject("outlook.application")
Dim mail As Outlook.MailItem
Set mail = app.CreateItem(olMailItem)
mail.To = contact
mail.subject = subject
mail.body = body
mail.Send
End Sub
Sub SendMassEmail()
Row = 1
Do
DoEvents
Row = Row + 1
Call SendEmail(Sheet1.Range("a" & Row), "test macro", "I am sending this e-mail using macro")
Loop Until Row = 4
End Sub
Bookmarks