Reasonably easy to do: (If I have the right end of the stick!)
1. Right - click your object browser and click components
2. In the Controls tab, choose Microsoft MAPI controls(whichever version)and click OK
3.Add a MAPISession control, a MAPIMessages control and a Command button to a form
Leave them as their original names...
4. Add the following code, putting your e-mail address and recipient address in place of examples :D
Private Sub Command1_Click()
'Create a simple html output for message
stroutput = "<html><div align=""center""><h1>HELLO WORLD</h></div></html>"
'MAPISession1.UserName = "
[email protected]"
'MAPISession1.Password = "password" You may or may not need these
MAPISession1.SignOn
MAPIMessages1.SessionID = MAPISession1.SessionID
MAPIMessages1.Compose
MAPIMessages1.RecipAddress = "
[email protected]"
MAPIMessages1.MsgSubject = "VBTest"
MAPIMessages1.MsgNoteText = stroutput
MAPIMessages1.ResolveName
MAPIMessages1.Send
MAPISession1.SignOff
End Sub
This works with my Outlook Express settings but dont forget to allow other programs to send mail in whatever mail application you use
Simon