Hey guys, im trying to get an email sent to various people, here is the code im currently using! please help ive been going crazy trying to find a way to send it to various people instead of just one
Private Sub Command0_Click( )
'Create some object variables for the various Notes objects
Dim NotesDB As Object
Dim NotesDoc As Object
Dim NotesRTF As Object
Dim NotesSession As Object
Dim txtDate
Dim strTo, strNCMR
'Get NCM#
'strNCMR = Me.txtRecID
'Define who to send e-mail to
strTo = "Email address" 'strQM
'Use Create object to instantiate a Notes session object
Set NotesSession = CreateObject("N otes.Notessessi on")
'Instantiate NotesDB object from method off NotesSession
Set NotesDB = NotesSession.ge tdatabase("", "")
NotesDB.openmai l
'Create new Notes document
Set NotesDoc = NotesDB.created ocument
'Send to strTo and set Subject of e-mail
Call NotesDoc.replac eitemvalue("Sen dto", strTo)
Call NotesDoc.replac eitemvalue("Sub ject", "NCMR # " & strNCMR)
'Creating the Body of the E-Mail
Set NotesRTF = NotesDoc.create richtextitem("b ody")
Call NotesRTF.append text("NCMR # " & strNCMR & " has been issued and needs your attention.")
'Save e-mail
NotesDoc.SAVEME SSAGEONSEND = True
'Send the e-mail
Call NotesDoc.Send(F alse)
'Destroy the Notes objects
Set NotesSession = Nothing
MsgBox "Email sent.", vbOKOnly + vbInformation, "Email "
End Sub
Private Sub Command0_Click( )
'Create some object variables for the various Notes objects
Dim NotesDB As Object
Dim NotesDoc As Object
Dim NotesRTF As Object
Dim NotesSession As Object
Dim txtDate
Dim strTo, strNCMR
'Get NCM#
'strNCMR = Me.txtRecID
'Define who to send e-mail to
strTo = "Email address" 'strQM
'Use Create object to instantiate a Notes session object
Set NotesSession = CreateObject("N otes.Notessessi on")
'Instantiate NotesDB object from method off NotesSession
Set NotesDB = NotesSession.ge tdatabase("", "")
NotesDB.openmai l
'Create new Notes document
Set NotesDoc = NotesDB.created ocument
'Send to strTo and set Subject of e-mail
Call NotesDoc.replac eitemvalue("Sen dto", strTo)
Call NotesDoc.replac eitemvalue("Sub ject", "NCMR # " & strNCMR)
'Creating the Body of the E-Mail
Set NotesRTF = NotesDoc.create richtextitem("b ody")
Call NotesRTF.append text("NCMR # " & strNCMR & " has been issued and needs your attention.")
'Save e-mail
NotesDoc.SAVEME SSAGEONSEND = True
'Send the e-mail
Call NotesDoc.Send(F alse)
'Destroy the Notes objects
Set NotesSession = Nothing
MsgBox "Email sent.", vbOKOnly + vbInformation, "Email "
End Sub
Comment