I have used several examples from MS in order to send email via VB. I get
an error "5" when I try to update and also when I rem out update and try to
send. It seems as though all other steps are working and talking. I would
eventually like to post several fields to a Public Folder but would be
happy just to send an email message. I have heard that Exchange is not
MAPISend compliant. Is there any truth to this? Please help... Thanks.
Below is the code I was using:
Dim objSession As Object ' Session object
Dim objMessage As Object ' Message object
Dim objOneRecip As Object ' Recipient object
On Error GoTo error_olemsg
' create a session then log on, supplying username and password
Set objSession = CreateObject("MAPI.Session")
' change the parameters to valid values for your configuration
' create a message and fill in its properties
Set objMessage = objSession.Outbox.Messages.Add
objMessage.Subject = "Gift of droids"
objMessage.Text = "Help us, Obi-wan. You are our only hope."
' create the recipient
Set objOneRecip = objMessage.Recipients.Add
objOneRecip.Name = "ed stark"
objOneRecip.Type = mapiTo
' send the message and log off
MsgBox "The message has been sent"
MsgBox "Error " & Str(Err) & ": " & Error$(Err)