All,
I have always used the Macro SendObject, form, HTML format, then set the to, subject and message in the macro.
I understand there is ways to do this using code so you don't have to go to the Notes client and click send with each email. However I am not quite understanding what needs to be done. I have found code such as below on some sites that say it will work, like -
Option Explicit
Private Sub SendEmailLotus()
Dim s As Object
Dim db As Object
Dim doc As Object
Dim sMsg As String
Set s = CreateObject("Notes.Notessession") 'Create notes session
Set db = s.getdatabase("", "") 'Set db to database not yet named
Call db.openmail 'Set database to default mail database
Set doc = db.createdocument 'Notesdocument '.New '(db) ' create a mail document
sMsg = "Mail has been sent: " & Date & " " & Time() & Chr$(10) & _
"This is a test of an email message from
VB." & vbCrLf & Text1.Text '
Call doc.replaceitemvalue("SendTo", "Eric Burdo") '
Call doc.replaceitemvalue("Subject", "
VB message") '
Call doc.replaceitemvalue("Body", sMsg) '
Call doc.Send(False) 'Send the message
MsgBox doc.getitemvalue("Body")(0) '
Set s = Nothing 'Close connection to free memory
Set db = Nothing 'Cleanup
Set doc = Nothing 'Cleanup
End Sub
However I am not quite sure how to set this up to email the information off of a form that opens in an email, and what variables I need to change in this code to make it work for my situation. The form has about 5 or 6 fields that need to be shown on the email (always liked the HTML format) when it opens. I can trigger the open when needed (when the condition to send the information via email is met).
Any help on this from someone who has past experience in making this work? I would like to have this just send behind the scenes.
Thanks for everyone's help both now and in the past!