Public Function send_mail(sendto As String, subject As String, _
text As String) As Boolean
'Add The MAPI Components and
'add a MAPI Session and MAPI mail control to your form
On Error GoTo ErrHandler
With MAPISession1
.DownLoadMail = False
.LogonUI = True
.SignOn
.NewSession = True
MAPIMessages1.SessionID = .SessionID
End With
With MAPIMessages1
.Compose
.RecipAddress = sendto
.AddressResolveUI = True
.ResolveName
.MsgSubject = subject
.MsgNoteText = text
.Send False
End With
sendmail = True
ErrHandler:
End Function