email blaster with CDONTS


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 7 of 7

Thread: email blaster with CDONTS

Hybrid View

  1. #1
    kyle Guest

    email blaster with CDONTS


    I have an email blaster written in asp. Everything works fine except this:

    Within the asp I have lines like this --
    **************************************************
    HTML = HTML & "<P>"
    HTML = HTML & "Dear "
    %>
    <% Response.Write rstBlast.Fields("FirstName") %>
    <%
    HTML = HTML & "<BR><BR>"
    HTML = HTML & "Thank you for your recent order..."
    **************************************************
    I get no errors, but I also get no "FirstName"
    Can anyone see what might be the problem here? And maybe make a suggestion
    that could save me hours. It would be greatly appreciated.


  2. #2
    Michael Guest

    Re: email blaster with CDONTS


    Kyle,
    I can't see the rest of your code but from what I see it looks like here
    you are building the email into a variable called HTML. The problem is your
    adding the first name using the write method of the response object. That
    won't insert the first name into the email you are building. It is sending
    (or atempting to) the first name to the client.
    Add this line to insert the first name...

    HTML = HTML & rstBlast.Fields("FirstName")

    Response object is used to send data to the client. If you are just populating
    variables or what not just concatenate the code like you would a string.

    Good luck and let me know if yo have any questions!
    Michael

    "kyle" <kfinch@bayoucitygroup.com> wrote:
    >
    >I have an email blaster written in asp. Everything works fine except this:
    >
    >Within the asp I have lines like this --
    >**************************************************
    >HTML = HTML & "<P>"
    >HTML = HTML & "Dear "
    >%>
    ><% Response.Write rstBlast.Fields("FirstName") %>
    ><%
    >HTML = HTML & "<BR><BR>"
    >HTML = HTML & "Thank you for your recent order..."
    >**************************************************
    >I get no errors, but I also get no "FirstName"
    >Can anyone see what might be the problem here? And maybe make a suggestion
    >that could save me hours. It would be greatly appreciated.
    >



  3. #3
    Q*Bert Guest

    Re: email blaster with CDONTS


    If however, your response.write is simply for your debugging purposes, you
    may need to put
    <%=rstBlast.Fields("FirstName")%>
    ^^^

    the '=' sign is important in this case; it tells the complier to simply write
    the variable out.

    Q*bert
    @(#$&*
    "Michael" <msanchez@runtimewebdev.com> wrote:
    >
    >Kyle,
    >I can't see the rest of your code but from what I see it looks like here
    >you are building the email into a variable called HTML. The problem is your
    >adding the first name using the write method of the response object. That
    >won't insert the first name into the email you are building. It is sending
    >(or atempting to) the first name to the client.
    >Add this line to insert the first name...
    >
    >HTML = HTML & rstBlast.Fields("FirstName")
    >
    >Response object is used to send data to the client. If you are just populating
    >variables or what not just concatenate the code like you would a string.
    >
    >Good luck and let me know if yo have any questions!
    >Michael
    >
    >"kyle" <kfinch@bayoucitygroup.com> wrote:
    >>
    >>I have an email blaster written in asp. Everything works fine except this:
    >>
    >>Within the asp I have lines like this --
    >>**************************************************
    >>HTML = HTML & "<P>"
    >>HTML = HTML & "Dear "
    >>%>
    >><% Response.Write rstBlast.Fields("FirstName") %>
    >><%
    >>HTML = HTML & "<BR><BR>"
    >>HTML = HTML & "Thank you for your recent order..."
    >>**************************************************
    >>I get no errors, but I also get no "FirstName"
    >>Can anyone see what might be the problem here? And maybe make a suggestion
    >>that could save me hours. It would be greatly appreciated.
    >>

    >



  4. #4
    Kyle Guest

    Re: email blaster with CDONTS


    Okay, now my code reads as follows:

    HTML = HTML & "</P>"
    HTML = HTML & "<P>Dear "%>
    <% =rstBlast.Fields("FirstName") %>
    <%
    HTML = HTML & ","
    HTML = HTML & "</P>"
    HTML = HTML & "<P>We appreciate your order..."

    I am still unsuccessful with trying to insert the customers name. Would it
    be helpful to see more of my code for this page?
    Thanks for your help.

    "Q*Bert" <luke_davis_76@hotmail.com> wrote:
    >
    >If however, your response.write is simply for your debugging purposes, you
    >may need to put
    ><%=rstBlast.Fields("FirstName")%>
    > ^^^
    >
    >the '=' sign is important in this case; it tells the complier to simply

    write
    >the variable out.
    >
    >Q*bert
    >@(#$&*
    >"Michael" <msanchez@runtimewebdev.com> wrote:
    >>
    >>Kyle,
    >>I can't see the rest of your code but from what I see it looks like here
    >>you are building the email into a variable called HTML. The problem is

    your
    >>adding the first name using the write method of the response object. That
    >>won't insert the first name into the email you are building. It is sending
    >>(or atempting to) the first name to the client.
    >>Add this line to insert the first name...
    >>
    >>HTML = HTML & rstBlast.Fields("FirstName")
    >>
    >>Response object is used to send data to the client. If you are just populating
    >>variables or what not just concatenate the code like you would a string.
    >>
    >>Good luck and let me know if yo have any questions!
    >>Michael
    >>
    >>"kyle" <kfinch@bayoucitygroup.com> wrote:
    >>>
    >>>I have an email blaster written in asp. Everything works fine except this:
    >>>
    >>>Within the asp I have lines like this --
    >>>**************************************************
    >>>HTML = HTML & "<P>"
    >>>HTML = HTML & "Dear "
    >>>%>
    >>><% Response.Write rstBlast.Fields("FirstName") %>
    >>><%
    >>>HTML = HTML & "<BR><BR>"
    >>>HTML = HTML & "Thank you for your recent order..."
    >>>**************************************************
    >>>I get no errors, but I also get no "FirstName"
    >>>Can anyone see what might be the problem here? And maybe make a suggestion
    >>>that could save me hours. It would be greatly appreciated.
    >>>

    >>

    >



  5. #5
    KI Guest

    Re: email blaster with CDONTS

    Looks like you need to do as Michael posted and concatenate the FirstName
    Variables to the rest of the message i.e

    HTML = HTML & "<P>"
    HTML = HTML & "Dear "
    HTML = HTML & rstBlast.Fields("FirstName")
    HTML = HTML & "<BR><BR>"
    HTML = HTML & "Thank you for your recent order..."

    providing rstBlast.Fields("FirstName") has value then this should output
    with the rest of the message.

    KI



    "kyle" <kfinch@bayoucitygroup.com> wrote in message
    news:3db7ffdd$1@tnews.web.devx.com...
    >
    > I have an email blaster written in asp. Everything works fine except this:
    >
    > Within the asp I have lines like this --
    > **************************************************
    > HTML = HTML & "<P>"
    > HTML = HTML & "Dear "
    > %>
    > <% Response.Write rstBlast.Fields("FirstName") %>
    > <%
    > HTML = HTML & "<BR><BR>"
    > HTML = HTML & "Thank you for your recent order..."
    > **************************************************
    > I get no errors, but I also get no "FirstName"
    > Can anyone see what might be the problem here? And maybe make a suggestion
    > that could save me hours. It would be greatly appreciated.
    >




  6. #6
    Jody Guest

    Re: email blaster with CDONTS

    You need to use:

    rstBlast.Fields.Item("FirstName").value
    ^^^^ ^^^^

    which is the correct syntax for extracting data from a db.


    Hope this helps


    Jody



    "Kyle" <kfinch@bayoucitygroup.com> wrote in message
    news:3db95a60$1@tnews.web.devx.com...
    >
    > Okay, now my code reads as follows:
    >
    > HTML = HTML & "</P>"
    > HTML = HTML & "<P>Dear "%>
    > <% =rstBlast.Fields("FirstName") %>
    > <%
    > HTML = HTML & ","
    > HTML = HTML & "</P>"
    > HTML = HTML & "<P>We appreciate your order..."
    >
    > I am still unsuccessful with trying to insert the customers name. Would it
    > be helpful to see more of my code for this page?
    > Thanks for your help.
    >
    > "Q*Bert" <luke_davis_76@hotmail.com> wrote:
    > >
    > >If however, your response.write is simply for your debugging purposes,

    you
    > >may need to put
    > ><%=rstBlast.Fields("FirstName")%>
    > > ^^^
    > >
    > >the '=' sign is important in this case; it tells the complier to simply

    > write
    > >the variable out.
    > >
    > >Q*bert
    > >@(#$&*
    > >"Michael" <msanchez@runtimewebdev.com> wrote:
    > >>
    > >>Kyle,
    > >>I can't see the rest of your code but from what I see it looks like here
    > >>you are building the email into a variable called HTML. The problem is

    > your
    > >>adding the first name using the write method of the response object.

    That
    > >>won't insert the first name into the email you are building. It is

    sending
    > >>(or atempting to) the first name to the client.
    > >>Add this line to insert the first name...
    > >>
    > >>HTML = HTML & rstBlast.Fields("FirstName")
    > >>
    > >>Response object is used to send data to the client. If you are just

    populating
    > >>variables or what not just concatenate the code like you would a string.
    > >>
    > >>Good luck and let me know if yo have any questions!
    > >>Michael
    > >>
    > >>"kyle" <kfinch@bayoucitygroup.com> wrote:
    > >>>
    > >>>I have an email blaster written in asp. Everything works fine except

    this:
    > >>>
    > >>>Within the asp I have lines like this --
    > >>>**************************************************
    > >>>HTML = HTML & "<P>"
    > >>>HTML = HTML & "Dear "
    > >>>%>
    > >>><% Response.Write rstBlast.Fields("FirstName") %>
    > >>><%
    > >>>HTML = HTML & "<BR><BR>"
    > >>>HTML = HTML & "Thank you for your recent order..."
    > >>>**************************************************
    > >>>I get no errors, but I also get no "FirstName"
    > >>>Can anyone see what might be the problem here? And maybe make a

    suggestion
    > >>>that could save me hours. It would be greatly appreciated.
    > >>>
    > >>

    > >

    >




  7. #7
    Michael Guest

    Re: email blaster with CDONTS


    Kyle,
    Did you read my original post?
    In addition...Using <% =rstBlast.Fields("FirstName") %> is the EXACT same
    as using response.write. You can not use response.write to add the users
    name. The response object is sending it to the client or the buffer NOT your
    HTML text.

    Simply add this...

    HTML = HTML & "<P>Dear " & rstBlast.Fields("FirstName")

    Good luck and let me know if you have questions.
    Michael
    msanchez@runtimewebdev.com

    "
    Kyle" <kfinch@bayoucitygroup.com> wrote:
    >
    >Okay, now my code reads as follows:
    >
    >HTML = HTML & "</P>"
    >HTML = HTML & "<P>Dear "%>
    ><% =rstBlast.Fields("FirstName") %>
    ><%
    >HTML = HTML & ","
    >HTML = HTML & "</P>"
    >HTML = HTML & "<P>We appreciate your order..."
    >
    >I am still unsuccessful with trying to insert the customers name. Would

    it
    >be helpful to see more of my code for this page?
    >Thanks for your help.
    >
    >"Q*Bert" <luke_davis_76@hotmail.com> wrote:
    >>
    >>If however, your response.write is simply for your debugging purposes,

    you
    >>may need to put
    >><%=rstBlast.Fields("FirstName")%>
    >> ^^^
    >>
    >>the '=' sign is important in this case; it tells the complier to simply

    >write
    >>the variable out.
    >>
    >>Q*bert
    >>@(#$&*
    >>"Michael" <msanchez@runtimewebdev.com> wrote:
    >>>
    >>>Kyle,
    >>>I can't see the rest of your code but from what I see it looks like here
    >>>you are building the email into a variable called HTML. The problem is

    >your
    >>>adding the first name using the write method of the response object. That
    >>>won't insert the first name into the email you are building. It is sending
    >>>(or atempting to) the first name to the client.
    >>>Add this line to insert the first name...
    >>>
    >>>HTML = HTML & rstBlast.Fields("FirstName")
    >>>
    >>>Response object is used to send data to the client. If you are just populating
    >>>variables or what not just concatenate the code like you would a string.
    >>>
    >>>Good luck and let me know if yo have any questions!
    >>>Michael
    >>>
    >>>"kyle" <kfinch@bayoucitygroup.com> wrote:
    >>>>
    >>>>I have an email blaster written in asp. Everything works fine except

    this:
    >>>>
    >>>>Within the asp I have lines like this --
    >>>>**************************************************
    >>>>HTML = HTML & "<P>"
    >>>>HTML = HTML & "Dear "
    >>>>%>
    >>>><% Response.Write rstBlast.Fields("FirstName") %>
    >>>><%
    >>>>HTML = HTML & "<BR><BR>"
    >>>>HTML = HTML & "Thank you for your recent order..."
    >>>>**************************************************
    >>>>I get no errors, but I also get no "FirstName"
    >>>>Can anyone see what might be the problem here? And maybe make a suggestion
    >>>>that could save me hours. It would be greatly appreciated.
    >>>>
    >>>

    >>

    >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center