Requires that your references include Microsoft CDO for Windows 2000 Library
and Microsoft ActiveX Objects 2.5 Library, but here it is:
' Reference to Microsoft ActiveX Data Objects 2.5 Library
' Reference to Microsoft CDO for Windows 2000 Library
Dim iConf As New CDO.Configuration
Dim Flds As ADODB.Fields
Set Flds = iConf.Fields
' Set the configuration
Flds(cdoSendUsingMethod) = cdoSendUsingPort
Flds(cdoSMTPServer) = "mail.example.com"
' ... other settings
Flds.Update
Dim iMsg As New CDO.Message
Set iMsg.Configuration = iConf
' Reference to Microsoft ActiveX Data Objects 2.5 Library
' Reference to Microsoft CDO for Windows 2000 Library
Dim iMsg As New CDO.Message
' configure message here if necessary
With iMsg
.To = "(e-mail address removed)"
.From = "(e-mail address removed)"
.CC = (e-mail address removed)
.Subject = "Test"
.TextBody = "Body of Message"
.AddAttachment "\\server\share\file.txt"
.Fields(cdoDispositionNotificationTo) = "(e-mail address removed)"
' finish and send
.Fields.Update
.Send
End With
Set iMsg = Nothing
Depending on what your doing you might need to concantonate the user entries
to populate the fields. ie,
strUserInput = txtText1 & " " & TxtText2 &, etc
strUserInput2 = "Sincerely, " & txtText3
then use, for example,
..TextBody = strUserUnput & vbcrlf & strUserUnput2 & vbcrlf
Note this is just an example and I made the text info up.