This forum is closed to new posts and
responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:
How do I code a LotusScript web service to accept a multivalued (array) input? I have a web service that simply sends an email given recipient, subject, and body text. This works as written but I want to modify it to accept multiple recipients. Not sure how to approach this? Any hints appreciated. Here's the code...
Dim s As NotesSession
Class SendEmail
Sub NEW
Set s = New NotesSession
End Sub
Function SendEmail(UserName As String, Password As String, SendTo As String, Subject As String, Body As String) As String
On Error Goto oops
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim rtitem As NotesRichTextItem
Dim msg As String
If UserName <> "Username" Or Password <> "Password" Then
SendEmail = "Login credentials incorrect. User not authenticated."
Exit Function
End If
If Subject = "" Then
SendEmail = "Subject is required"
Exit Function
End If
If Body = "" Then
SendEmail = "Body is required"
Exit Function
End If
If Not s.CurrentDatabase.IsOpen Then
SendEmail = "Couldn't open database"
Exit Function
End If
Set doc = s.CurrentDatabase.CreateDocument
doc.Form = "Memo"
doc.Principal = "no-reply@company.com"
doc.InetFrom = "no-reply@company.com"
doc.From = "no-reply@company.com"
doc.Subject = Subject
Set rtitem = New NotesRichTextItem(doc, "Body")
rtitem.AppendText(Body)
On Error Goto sendoops
Call doc.Send(False, SendTo)
On Error Goto oops
SendEmail = "Message successfully sen!"
Exit Function
oops:
msg = Error$ & " on " & Cstr(Erl)
Msgbox msg
SendEmail = msg
Resume done
sendoops:
msg= "Couldn't send message: " & Error$
Msgbox msg
SendEmail = msg
Resume done
done:
End Function
End Class
Feedback number WEBB83329U created by ~Dan Umfanaverobu on 02/27/2010
Status: Open
Comments: