Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Jmail recipients

Status
Not open for further replies.

JazzLeg

Programmer
Aug 22, 2002
63
GB
hi,
When using jmail, can more than 1 recipient be used in the AddRecipient setting?

If so, how?

Thanks

 
Yes - it's fairly simple - you can do it either like this:

jmail.AddRecipient "blah1@blah.co.uk"
jmail.AddRecipient "blah2@blah.co.uk"

or you can do it dynamically - shown in the below code

Mark

------------------------------

<%@ Language=VBScript %>
<!-- #include file=&quot;dbConn.asp&quot; -->

<html>
<head>
</head>
<body>

<%
Set jmail = Server.CreateObject(&quot;JMail.Message&quot;)

Set rsListVotes = Server.CreateObject(&quot;ADODB.Recordset&quot;)
Set rsListVotes = dbConn.Execute( &quot;SELECT * FROM vw_Usernames

while rsListVotes.EOF = false
jmail.AddRecipient rsListVotes(&quot;username&quot;)&&quot;@blah.co.uk&quot;
rsListVotes.MoveNext
Wend

jmail.From = &quot;wizard@blah.co.uk&quot;
jmail.Subject = &quot;This months OnFriday Arrangement&quot;
jmail.Body = &quot;This is an automated e-mail&quot;
jmail.Send( &quot;172.116.12.17&quot; )
%>

Email Sent
</body>
</html>

<%set rsListVotes = nothing%>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top