Ok, previously I had a thread regarding getting a warning message about "this program is using the Address book, would you like it to allow access" etc. Well the suggestion was to use CDO. Unfortunately CDO is coming up with the same problem. What is wrong with this code?
code:<HR>Code:Public Function iSendEmail() Dim objsession As Object Dim objmessage As Object Dim objrecipient As Object 'Create the Session Object Set objsession = CreateObject("mapi.session") 'This must be a valid Logon name, based on the computer it is installed on. objsession.Logon profileName:="ALocalAdmin" 'Add a new message object to the Outbox Set objmessage = objsession.Outbox.Messages.Add 'Set the properties of the message object objmessage.Subject = "This is a test." objmessage.Text = "This is the message text." 'Add a recipient object to the objmessage.recipients.add Set objrecipient = objmessage.Recipients.Add 'Set the properties fo the recipient object objrecipient.Name = "user@somewhere.com" 'Type can be ActMsgTo, mapito, or Cdoto for different cdo versions objrecipient.Type = mapiTo objrecipient.Resolve 'Send the message objmessage.Send showDialog:=False MsgBox "Message sent successfully" 'logoff using the session object objsession.Logoff Set objsession = Nothing Set objmessage = Nothing Set objrecipient = Nothing End Function