Re: email data from form
From: Steve (sschmideler_at_perfect-product.com)
Date: 04/27/04
- Next message: Stephen Lebans: "Re: Disable Mouse Wheel Access 2003/2002"
- Previous message: Eduardo Leaderez: "Re: continuous form fonts"
- In reply to: Brian C: "email data from form"
- Next in thread: anonymous_at_discussions.microsoft.com: "Re: email data from form"
- Reply: anonymous_at_discussions.microsoft.com: "Re: email data from form"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 27 Apr 2004 15:55:35 -0500
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 = "user@domain.com"
.From = "user@domain.com"
.CC = user@domain.com
.Subject = "Test"
.TextBody = "Body of Message"
.AddAttachment "\\server\share\file.txt"
.Fields(cdoDispositionNotificationTo) = "user@domain.com"
' 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.
"Brian C" <anonymous@discussions.microsoft.com> wrote in message
news:504201c42c97$43dd31b0$a401280a@phx.gbl...
> I have a form in which a user can type data plus an email
> address and I then want to send that data to the email as
> a message.
>
> Can I do this in ACCESS and if so how or where can I find
> an example? Thanks
- Next message: Stephen Lebans: "Re: Disable Mouse Wheel Access 2003/2002"
- Previous message: Eduardo Leaderez: "Re: continuous form fonts"
- In reply to: Brian C: "email data from form"
- Next in thread: anonymous_at_discussions.microsoft.com: "Re: email data from form"
- Reply: anonymous_at_discussions.microsoft.com: "Re: email data from form"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|