Skip to main content
Inspiring
March 22, 2007
Question

Mailing List From Database via Outlook

  • March 22, 2007
  • 2 replies
  • 276 views
I have a table that has the names and email addresses of a group of individuals. I want to just have an E-Mail All link or button that with one click will open Outlook and insert all of the names into the To: line. I know there are much better ways to do this, but the security settings of my IIS Server prevent me from doing anything on the server end (like PHPMail does).

At home, I did this on my own site (in PHP/MySQL) by just creating a quick binding to a table cell, adding a repeat region server behavior, stripping out the table tags, opening the properties of the E-Mail All button and then copying the entire php repeat region code into the Link box and slapping a mailto: in front of it and a semi-colon+space (the Outlook separator) at the end. It immediately worked like a charm and has done so for almost 2 years. Everytime my user database changes, the mailto: name list changes with it.

But with ASP/VBScript, it fails miserably. I get 500.100 server errors in IE. Specifically on this script call:
<% Repeat1__index=Repeat1__index+1 Repeat1__numRows=Repeat1__numRows-1 rs_mailall.MoveNext() Wend %>

The basic Repeat Region is this (td tags sripped out mind you):
<%
While ((Repeat1__numRows <> 0) AND (NOT rs_mailall.EOF))
%>
<%=(rs_mailall.Fields.Item("email").Value)%>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rs_mailall.MoveNext()
Wend
%>

Standing alone, the repeat region works just fine.

My Modified Mailto:

<a href="mailto:<% While ((Repeat1__numRows <> 0) AND (NOT rs_mailall.EOF)) %><%=(rs_mailall.Fields.Item("email").Value)%><% Repeat1__index=Repeat1__index+1 Repeat1__numRows=Repeat1__numRows-1 rs_mailall.MoveNext() Wend %>">E-Mail All Users</a>

As I said, doing the exact same thing on my PHP page works like a charm. What am I missing with ASP/VBScript?

Cheers

Chuck
This topic has been closed for replies.

2 replies

Inspiring
March 22, 2007
If you are using the same Repeat region twice in the page you are bound to
have it fail. Think of a repeat region as a casette tape. Once played it is
at the end, and if you tried to play it again it would fail. To make it
rewind change the cursor type from forward only to dynamic. You do this by
clicking on the recordset in the server behaviour panel and the cursor type
will appear in the PI.
--
Paul Whitham
Certified Dreamweaver MX2004 Professional
Adobe Community Expert - Dreamweaver

Valleybiz Internet Design
www.valleybiz.net

"chuckomalley" <webforumsuser@macromedia.com> wrote in message
news:ettaqp$l2l$1@forums.macromedia.com...
>I have a table that has the names and email addresses of a group of
> individuals. I want to just have an E-Mail All lind or button that with
> one
> click will open Outlook and insert all of the names into the To: line. I
> know
> there are much better ways to do this, but the security settings of my IIS
> Server prevent me from doing anything on the server end (like PHPMail
> does).
>
> At home, I did this on my own site (in PHP/MySQL) by just creating a quick
> binding to a table cell, adding a repeat region server behavior, stripping
> out
> the table tags, opening the properties of the E-Mail All button and then
> copying the entire php repeat region code into the Link box and slapping a
> mailto: in front of it and a semi-colon+space (the Outlook separator) at
> the
> end. It immediately worked like a charm and has done so for almost 2
> years.
> Everytime my user database changes, the mailto: name list changes with it.
>
> But with ASP/VBScript, it fails miserably. I get 500.100 server errors in
> IE.
> Specifically on this script call:
> <% Repeat1__index=Repeat1__index+1 Repeat1__numRows=Repeat1__numRows-1
> rs_mailall.MoveNext() Wend %>
>
> The basic Repeat Region is this (td tags sripped out mind you):
> <%
> While ((Repeat1__numRows <> 0) AND (NOT rs_mailall.EOF))
> %>
> <%=(rs_mailall.Fields.Item("email").Value)%>
> <%
> Repeat1__index=Repeat1__index+1
> Repeat1__numRows=Repeat1__numRows-1
> rs_mailall.MoveNext()
> Wend
> %>
>
> Standing alone, the repeat region works just fine.
>
> My Modified Mailto:
>
> <a href="mailto:<% While ((Repeat1__numRows <> 0) AND (NOT
> rs_mailall.EOF))
> %><%=(rs_mailall.Fields.Item("email").Value)%><%
> Repeat1__index=Repeat1__index+1 Repeat1__numRows=Repeat1__numRows-1
> rs_mailall.MoveNext() Wend %>">E-Mail All Users</a>
>
> As I said, doing the exact same thing on my PHP page works like a charm.
> What
> am I missing with ASP/VBScript?
>
> Cheers
>
> Chuck
>


Inspiring
March 23, 2007
Having done ASP VBScript for so long, I never set up recordsets without making the Cursor Dynamic and the Lock Type Optimistic.

Its still fails though.

Cheers

Chuck
Inspiring
March 22, 2007
If you are using asp vbscript then use CDOSys instead of the mailto. Just
set up the CDOSys script and place it inside your loop.


"chuckomalley" <webforumsuser@macromedia.com> wrote in message
news:ettaqp$l2l$1@forums.macromedia.com...
>I have a table that has the names and email addresses of a group of
> individuals. I want to just have an E-Mail All lind or button that with
> one
> click will open Outlook and insert all of the names into the To: line. I
> know
> there are much better ways to do this, but the security settings of my IIS
> Server prevent me from doing anything on the server end (like PHPMail
> does).
>
> At home, I did this on my own site (in PHP/MySQL) by just creating a quick
> binding to a table cell, adding a repeat region server behavior, stripping
> out
> the table tags, opening the properties of the E-Mail All button and then
> copying the entire php repeat region code into the Link box and slapping a
> mailto: in front of it and a semi-colon+space (the Outlook separator) at
> the
> end. It immediately worked like a charm and has done so for almost 2
> years.
> Everytime my user database changes, the mailto: name list changes with it.
>
> But with ASP/VBScript, it fails miserably. I get 500.100 server errors in
> IE.
> Specifically on this script call:
> <% Repeat1__index=Repeat1__index+1 Repeat1__numRows=Repeat1__numRows-1
> rs_mailall.MoveNext() Wend %>
>
> The basic Repeat Region is this (td tags sripped out mind you):
> <%
> While ((Repeat1__numRows <> 0) AND (NOT rs_mailall.EOF))
> %>
> <%=(rs_mailall.Fields.Item("email").Value)%>
> <%
> Repeat1__index=Repeat1__index+1
> Repeat1__numRows=Repeat1__numRows-1
> rs_mailall.MoveNext()
> Wend
> %>
>
> Standing alone, the repeat region works just fine.
>
> My Modified Mailto:
>
> <a href="mailto:<% While ((Repeat1__numRows <> 0) AND (NOT
> rs_mailall.EOF))
> %><%=(rs_mailall.Fields.Item("email").Value)%><%
> Repeat1__index=Repeat1__index+1 Repeat1__numRows=Repeat1__numRows-1
> rs_mailall.MoveNext() Wend %>">E-Mail All Users</a>
>
> As I said, doing the exact same thing on my PHP page works like a charm.
> What
> am I missing with ASP/VBScript?
>
> Cheers
>
> Chuck
>