Skip to main content
Inspiring
April 29, 2008
Answered

How to Create an email list from a set of records?

  • April 29, 2008
  • 4 replies
  • 440 views
I have an address database which also contains email addresses. The data is catagorised into groups like officer, delegate, Government. I need to extract the email addresses from any particular group, and add them together so that I can use them in an email link. This will enable my users to send emails to a particular group of people in the database

EG. - fred@fred.com;peter@peter.com;william@yahoo.com


I can sort the list to show only email addresses, but how do I produce them in a format similar to the above, and then turn that into an email link which will start the users emailpackage with the list of names in the address bar.
This topic has been closed for replies.
Correct answer whatalotofrubbish
Originally, I posted "This looks like the answer" and ticjked the post above.

It turned out nearly correct, but there was a bit missing, and some syntax changes (could it be code shorthand?) needed.
The answer above relies on previous code to show a repeat region. In order for it to work in CS3, it needs the following minor changes:

<p><a href="mailto:
<%rsemails.MoveFirst()
while ((Repeat1__numRows-- != 0) && (!rsemails.EOF)) { %>

<%=(rsemails.Fields.Item("email").Value)%>;
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rsemails.MoveNext()
}
%>
">Email All</a></p>

Apart from the change in dialect, the important bit is:

rsemails.MoveFirst()

This moves the pointer to the first record of the recordset. Prior to the above code, there is a repeat region listing names and email addresses singly. At that point, the pointer is at the end of the file, and needs to be moved back to the beginning.

This bit of code supplied in the answer above:
<%
While ((Repeat1__numRows <> 0) AND (NOT rsemails.EOF))
%>
Would not work at all in CS3 for some reason, so I copied the code generated by CS3 for a repeat region and it worked fine.

It was very interesting to get the code working, and it took me about 2 hours and lots of reasoning and web searching. Learnt a lot!

Thanks Ken for giving me 95%.

4 replies

whatalotofrubbishAuthorCorrect answer
Inspiring
April 29, 2008
Originally, I posted "This looks like the answer" and ticjked the post above.

It turned out nearly correct, but there was a bit missing, and some syntax changes (could it be code shorthand?) needed.
The answer above relies on previous code to show a repeat region. In order for it to work in CS3, it needs the following minor changes:

<p><a href="mailto:
<%rsemails.MoveFirst()
while ((Repeat1__numRows-- != 0) && (!rsemails.EOF)) { %>

<%=(rsemails.Fields.Item("email").Value)%>;
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rsemails.MoveNext()
}
%>
">Email All</a></p>

Apart from the change in dialect, the important bit is:

rsemails.MoveFirst()

This moves the pointer to the first record of the recordset. Prior to the above code, there is a repeat region listing names and email addresses singly. At that point, the pointer is at the end of the file, and needs to be moved back to the beginning.

This bit of code supplied in the answer above:
<%
While ((Repeat1__numRows <> 0) AND (NOT rsemails.EOF))
%>
Would not work at all in CS3 for some reason, so I copied the code generated by CS3 for a repeat region and it worked fine.

It was very interesting to get the code working, and it took me about 2 hours and lots of reasoning and web searching. Learnt a lot!

Thanks Ken for giving me 95%.
Inspiring
April 29, 2008
<a href="mailto:
<%
While ((Repeat1__numRows <> 0) AND (NOT rsemails.EOF))
%>
<%=(rsemails.Fields.Item("rep_email").Value)%>;
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rsemails.MoveNext()
Wend
%>
">Email All</a>

--
Ken Ford
Adobe Community Expert - Dreamweaver
Fordwebs, LLC
http://www.fordwebs.com


"whatalotofrubbish" <webforumsuser@macromedia.com> wrote in message
news:fv7iu3$nn8$1@forums.macromedia.com...
> ASP Javascript

Inspiring
April 29, 2008
ASP Javascript
Inspiring
April 29, 2008
What server-side language are you using?

--
Ken Ford
Adobe Community Expert - Dreamweaver
Fordwebs, LLC
http://www.fordwebs.com


"whatalotofrubbish" <webforumsuser@macromedia.com> wrote in message
news:fv72km$6vs$1@forums.macromedia.com...
>I have an address database which also contains email addresses. The data is
> catagorised into groups like officer, delegate, Government. I need to
> extract
> the email addresses from any particular group, and add them together so
> that I
> can use them in an email link. This will enable my users to send emails to
> a
> particular group of people in the database
>
> EG. - fred@fred.com;peter@peter.com;william@yahoo.com
>
>
> I can sort the list to show only email addresses, but how do I produce
> them in
> a format similar to the above, and then turn that into an email link which
> will
> start the users emailpackage with the list of names in the address bar.
>