Send Automatic emails using Macros

Closed
DrewTully Posts 1 Registration date Thursday January 10, 2019 Status Member Last seen January 10, 2019 - Updated on Jan 10, 2019 at 08:50 PM
 Blocked Profile - Jan 10, 2019 at 10:05 PM
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
Related:

1 response

Blocked Profile
Jan 10, 2019 at 10:05 PM
YEA!


0