Sorry if I seem a bit dense. This is my original script.
Function Email(Message as String)
Dim objSession As Object
Dim objMessage As Object
Dim objRecipient As Object
Dim sProfile As String
'You can specify any name you desire
sProfile = "Company Exchange"
' Create the Session Object.
Set objSession = CreateObject("mapi.session"

objSession.Logon profileName:=sProfile
' Add a new message object to the OutBox.
Set objMessage = objSession.Outbox.Messages.Add
' Set the properties of the message object.
objMessage.Subject = "Errors occured during update"
objMessage.Text = Message
' Add a recipient object to the objMessage.Recipients collection.
Set objRecipient = objMessage.Recipients.Add
' Set the properties of the recipient object.
objRecipient.Name = "firstname.lastname"
objRecipient.Resolve
' Send the message. Setting showDialog to False
' sends the message without displaying the message
' or requiring user intervention. A setting of True
' displays the message and the user must choose
' to Send from within the message dialog.
objMessage.Send showDialog:=False
' Log off using the session object.
objSession.Logoff
End Function
Sub Main()
EMAIL "Reports did not update The problem is being investigated"
End Sub
Here is the new one.
Function Email(Message as String)
Dim objSession As Object
Dim objMessage As Object
Dim objRecipient As Object
Dim objOutlookEMail As Object
Dim sProfile As String
'You can specify any name you desire
sProfile = "Company Exchange"
' Create the Session Object.
Set objSession = CreateObject("mapi.session"

objSession.Logon profileName:=sProfile
' Add a new message object to the OutBox.
Set objMessage = objSession.Outbox.Messages.Add
' Set the properties of the message object.
objMessage.Subject = "Errors occured during update"
objMessage.Text = Message
' Add a recipient object to the objMessage.Recipients collection.
Set objRecipient = objMessage.Recipients.Add
set objOutlookEMail = objMessage.Recipients.add
' Set the properties of the recipient object.
objOutlookEMail.Name = "firstname.lastname"
objRecipient.Name = "firstname.lastname"
objRecipient.Resolve
' Send the message. Setting showDialog to False
' sends the message without displaying the message
' or requiring user intervention. A setting of True
' displays the message and the user must choose
' to Send from within the message dialog.
objMessage.Send showDialog:=False
' Log off using the session object.
objSession.Logoff
End Function
Sub Main()
EMAIL "Reports did not update The problem is being investigated"
End Sub
Any help with the syntax would be very helpful.
VTJ