Send Automatic emails using Macros

Posts
1
Registration date
Thursday January 10, 2019
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 

Your reply

1 reply

Posts
11176
Registration date
Monday June 3, 2013
Status
Contributor
Last seen
January 18, 2019
1879
0
Thank you
YEA!


Respond to ac3mark