to start and fill out an email using Outlook Express use the code below.
Note: you must install 1 command button and MAPI32 Controls 6.0. The attached file must exist in a valid directory here the code:


[Option Explicit
Private bNewSession As Boolean ' Flag to signal logon status.
Dim Recipent As String
Dim Subject As String
Dim NoteText As String
Dim Attachment As String


Private Sub ComposeMessage(Recipent As String, Optional Subject As String, _
Optional NoteText As String, Optional Attachment As String)
With MAPIMessages1
.Compose
.RecipAddress = Recipent
.MsgSubject = Subject
.MsgNoteText = NoteText
.AttachmentPathName = Attachment
.Send True 'if you would like to send the mail straight away
End With
End Sub

Private Function LogOn() As Boolean
If MAPISession1.NewSession Then
MsgBox "Session already established"
Exit Function
End If
On Error GoTo errLogInFail
With MAPISession1
.DownLoadMail = False ' Set DownLoadMail to False to prevent immediate download.
'.LogonUI = True ' Use the underlying email system's logon UI.
.SignOn ' Signon method.
.NewSession = True
bNewSession = .NewSession
MAPIMessages1.SessionID = .SessionID ' You must set this before continuing.

End With
Exit Function

errLogInFail:
Debug.Print Err.Number, Err.Description
If Err.Number = 32003 Then
MsgBox "Canceled Login"
LogOn = False
End If
Exit Function
End Function

Private Sub LogOff()
If MAPISession1.SessionID <> 0 Then MAPISession1.SignOff
With MAPISession1
.NewSession = False ' Flag for new session.
bNewSession = .NewSession ' Reset flag.
End With
End Sub


Private Sub Command1_Click()
LogOn
ComposeMessage "[email protected]", "Test", "Some notes", "C:\autoexec.bat"
End Sub]