Send Automatic emails using Macros [Closed]

Report
Posts
1
Registration date
Thursday January 10, 2019
Status
Member
Last seen
January 10, 2019
-
 Blocked Profile -
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

1 reply


YEA!