Send Automatic emails using Macros

Posts
1
Registration date
Thursday January 10, 2019
Status
Member
Last seen
January 10, 2019
-
If column F in any worksheet in entire workbook is changed to "Pending" send an email. Below is my macro so far.

Sub Request()

Dim OutApp As Object
Dim OutMail As Object
Dim strbody As String

Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
strbody = "HEY" & vbNewLine & vbNewLine & _
"this is Some Dummy text" & vbNewLine & _
"Via: A.t@s.com & vbNewLine"

On Error Resume Next

With OutMail
.to = "a.T@s.com"
.CC = ""
.BCC = ""
.Subject = "Sample Subject"
.body = strbody
.send

End With

On Error GoTo 0

Set OutMail = Nothing

Set OutApp = Nothing
End Sub
See more 

1 reply

Posts
13035
Registration date
Monday June 3, 2013
Status
Moderator
Last seen
October 11, 2019
1479
0
Thank you
YEA!


Respond to ac3mark