Unable to get email notifciation

Closed
Sudhakar M - Oct 6, 2015 at 07:35 AM
rizvisa1 Posts 4479 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Oct 7, 2015 at 01:53 PM
Hello,

I have placed below noted in my excel. but I am unable to get the email to my ID.

Please help me

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, _
Cancel As Boolean)

Dim answer As String

answer = MsgBox("save", [vbYesNo = vbOKOnly], "Saving Box")

If answer = vbNo Then Cancel = True
If answer = vbYes Then
'open outlook type stuff
Set OutlookApp = CreateObject("Outlook.Application")
Set OlObjects = OutlookApp.GetNamespace("MAPI")
Set newmsg = OutlookApp.CreateItem(olMailItem)
'add recipients
'newmsg.Recipients.Add ("Sudhakar Mahankali")
newmsg.Recipients.Add ("***@***")
'add subject
newmsg.Subject = "Security Checklist updated"
'add body
newmsg.Body = "This is to inform your that, we have updated the Security Checklist accordingly."
newmsg.Display 'display
newmsg.Send 'send message
'give conformation of sent message
MsgBox "insert confirmation box test here", , "title of confirmation box"

End If

'save the document
'Me.Worksheets.Save

End Sub





1 reply

rizvisa1 Posts 4479 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 768
Oct 6, 2015 at 12:03 PM
I assume this is not in your actual code

'newmsg.Recipients.Add ("Sudhakar Mahankali")
newmsg.Recipients.Add ("***@***")
and you have your email id instead of ****
0
Can you help me with the correct notes?
0
rizvisa1 Posts 4479 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 768
Oct 7, 2015 at 01:53 PM
what you meant correct notes ?'
instead of ***@*** you need to have proper email address like someone@somewhere.com
0