I'm using the following code that I found to create an email with GroupWise 6.5. I modified a few thing so it's a little different from the original I was wonder how I can send the message to multiple recipients when adding 2 or more email addresses in the txtTo textbox on my form.
I thought that the following code might send the message to another person( strRecTo(1, 0) = "jdoe@12345.com") but it did not work. Also I tried entering the email address like this in txtTo field, but it did not work either. (johndoe@12345.com;janedoe@12345.com).
Can anyone tell if there something that I need to change or add? The code uses a module named GW that I imported into the database.
Thanks!
Private Sub btnCreateEmail_Click()
On Error GoTo Err_Handler
Dim strTemp As String
''Dim varAttach(1) As Variant
Dim strRecTo(1, 0) As String
Dim lngCount As Long
Dim varProxies As Variant
Dim cGW As GW
Dim ErrorMessage As String
ErrorMessage = ""
''varAttach(0) = "c:\command.com"
''varAttach(1) = "c:\windows\readme.txt"
If IsNull(Me.txtTo) = False Then
strRecTo(0, 0) = Me.txtTo
strRecTo(1, 0) = "jdoe@12345.com"
Else
ErrorMessage = ErrorMessage & " There is no TO: address listed."
End If
Set cGW = New GW
With cGW
.Login
.RecTo = strRecTo
.Priority = "Medium"
' .FileAttachments = varAttach
' .FromText = Me.txtFrom
If IsNull(Me.txtBody) = False Then .BodyText = Me.txtBody
If IsNull(Me.txtSubject) = False Then .Subject = Me.txtSubject
If IsNull(Me.txtBc) = False Then .RecBc = Me.txtBc
If IsNull(Me.txtCC) = False Then .RecCc = Me.txtCC
strTemp = .CreateMessage
.ResolveRecipients strTemp
If IsArray(.NonResolved) Then MsgBox "Some unresolved recipients." & ErrorMessage
.SendMessage strTemp
.DeleteMessage strTemp, True
End With
Exit_Here:
Set cGW = Nothing
Exit Sub
Err_Handler:
MsgBox "Error " & Err.Number & ": " & Err.Description, vbCritical
Resume Exit_Here
End Sub
I thought that the following code might send the message to another person( strRecTo(1, 0) = "jdoe@12345.com") but it did not work. Also I tried entering the email address like this in txtTo field, but it did not work either. (johndoe@12345.com;janedoe@12345.com).
Can anyone tell if there something that I need to change or add? The code uses a module named GW that I imported into the database.
Thanks!
Private Sub btnCreateEmail_Click()
On Error GoTo Err_Handler
Dim strTemp As String
''Dim varAttach(1) As Variant
Dim strRecTo(1, 0) As String
Dim lngCount As Long
Dim varProxies As Variant
Dim cGW As GW
Dim ErrorMessage As String
ErrorMessage = ""
''varAttach(0) = "c:\command.com"
''varAttach(1) = "c:\windows\readme.txt"
If IsNull(Me.txtTo) = False Then
strRecTo(0, 0) = Me.txtTo
strRecTo(1, 0) = "jdoe@12345.com"
Else
ErrorMessage = ErrorMessage & " There is no TO: address listed."
End If
Set cGW = New GW
With cGW
.Login
.RecTo = strRecTo
.Priority = "Medium"
' .FileAttachments = varAttach
' .FromText = Me.txtFrom
If IsNull(Me.txtBody) = False Then .BodyText = Me.txtBody
If IsNull(Me.txtSubject) = False Then .Subject = Me.txtSubject
If IsNull(Me.txtBc) = False Then .RecBc = Me.txtBc
If IsNull(Me.txtCC) = False Then .RecCc = Me.txtCC
strTemp = .CreateMessage
.ResolveRecipients strTemp
If IsArray(.NonResolved) Then MsgBox "Some unresolved recipients." & ErrorMessage
.SendMessage strTemp
.DeleteMessage strTemp, True
End With
Exit_Here:
Set cGW = Nothing
Exit Sub
Err_Handler:
MsgBox "Error " & Err.Number & ": " & Err.Description, vbCritical
Resume Exit_Here
End Sub