Jmail only sending "body" in first run of loop

Ask a Question related to Dreamweaver AppDev, Design and Development.

  1. #1

    Default Jmail only sending "body" in first run of loop

    I have designed a newsletter that will send any news to my subscribers as soon
    as it is added to my front page. I have four dynamic bindings which are: email,
    title, date and body. the first three bindings work fine through the 'while'
    loop and each subscriber does receive an email with the title and date present.
    However, when it comes to the body only the first subscriber recieves the body
    and all others are blank. this is really puzzling me and i have no reason why
    this is happening ... Has anyone experienced anything like this before? After
    the while loop the page produces the newsletter underneath so i can see what
    they have recieved and this also has no body text. Here is my 'while' loop ->
    Code:
     <%  While ((Repeat1__numRows <> 0) AND (NOT rs_email.EOF))  %> <% Dim
    fullName, email  FullName = 0 email = 0 fullName =
    (rs_email.Fields.Item('fullName').Value) email =
    (rs_email.Fields.Item('email').Value) 'email = 'garrybibson@hotmail.com'  set
    msg = Server.CreateOBject( 'JMail.Message' ) msg.ContentType = 'text/html'
    msg.Logging = true msg.silent = true msg.From = 'info@stelphick.com'
    msg.AddRecipient email  msg.Subject = 'Stelphick United Newsletter' 'msg.Body =
    'News has been added to the Stelphick United Website, please follow this link
    to read it! www.stelphick.com/news.asp'    msg.Body = '<style
    type=''text/css''>.titlegreen {font-family: verdana;font-size: 13px;color:
    #003333;font-weight: bold;text-transform: capitalize;}--></style>' msg.Body =
    msg.Body &amp; '<style type=''text/css''>.standard {font-family:
    verdana;font-size: 12px;color: #000000;}--></style>' msg.Body = msg.Body &amp;
    '<style type=''text/css''>.date {font-family: verdana;font-size:
    12px;font-weight: lighter;color: #000000;}--></style>' msg.Body = msg.Body
    &amp; '<style type=''text/css''> A:link {FONT-WEIGHT: bold;FONT-SIZE:
    12px;COLOR: #336666;font-family: Verdana;}--></style>' msg.Body = msg.Body
    &amp; '<style type=''text/css''> A:visited {FONT-WEIGHT: bold; FONT-SIZE: 12px;
    COLOR: #336666;  font-family: Verdana;}--></style>' msg.Body = msg.Body &amp;
    '<style type=''text/css''> A:hover {FONT-WEIGHT: bold; FONT-SIZE: 12px; COLOR:
    #000000; font-family: Verdana;}--></style>' msg.Body = msg.Body &amp; '<span
    class=''titlegreen''>' msg.Body = msg.Body &amp; '<table width=''600''
    ><tr><td><img src=''http://www.stelphick.com/images/emailnews.jpg''
    /></td></tr>' msg.Body = msg.Body &amp; '<tr><td><table width=''100%'' cellspacing=''3''><tr><td><table width=''100%'' background=''http://www.stelphick.com/images/dotted2.gif''><tr><td class=''titlegreen''>' msg.Body = msg.Body &amp; (rs_news.Fields.Item('title').Value) msg.Body = msg.Body &amp; '</td><td class=''date''><div align=''right''>' msg.Body = msg.Body &amp; (rs_news.Fields.Item('newsdate').Value) msg.Body = msg.Body &amp; '</div></td></tr></table></td></tr><tr><td class=''standard''><div align=''justify''>' msg.Body = msg.Body &amp; (rs_news.Fields.Item('body').Value) msg.Body = msg.Body &amp; '</div></td></tr><tr><td class=''greentitle''><a href=http://www.stelphick.com>Click here to visit the Stelphick United Website</a></td></tr></table></td></tr></table>' 'msg.Body = msg.Body &amp; (rs_news.Fields.Item('title').Value) 'msg.Body = msg.Body &amp; '</span>' 'msg.Body = msg.Body &amp; '<span class=''date''>' 'msg.Body = msg.Body &amp; (rs_news.Fields.Item('newsdate').Value) 'msg.Body = msg.Body &amp; '</span>' 'msg.Body = msg.Body &amp; '<br />' 'msg.Body = msg.Body &amp; '<span class=''standard''>' 'msg.Body = msg.Body &amp; (rs_news.Fields.Item('body').Value) 'msg.Body = msg.Body &amp; '</span>' if not msg.Send('10.2.0.81') then Response.write 'Error Please email info@stelphick.com' else Response.write 'Message sent succesfully!' end if %> <p>Recipients</p> <table width='500' border='0' cellspacing='0' cellpadding='0'> <tr> <td width='50%'><%=(rs_email.Fields.Item('fullName').Value)%></td> <td width='50%'><%=(rs_email.Fields.Item('email').Value)%></td> </tr> </table> <% Repeat1__index=Repeat1__index+1 Repeat1__numRows=Repeat1__numRows-1 rs_email.MoveNext() Wend %>
    baz0hara Guest

  2. Similar Questions and Discussions

    1. cfprocparam sending "???????" to SQL Server
      I have a SQL Server stored procedure that expects an nvarchar parameter. The cfprocparam is sending Russian characters, but the stored proc seems...
    2. "activation required" loop
      every day i use FHMXa, it requires an internet activation... i've contacted the hotline, they gave me a de-install and re-install procedure that...
    3. Sending "forms" without text?? Please help
      Hi, my knowledge of Flash so far is very basic but I am trying to learn. I would like to know if it's possible to do a screen capture and mail...
    4. Problem sending mail on Server 2003 "SendUsing" configuration is invalid
      Hi, I have a C# asp.net app that sent mail fine on server 2000 or win 2000, but now I moved it to our new 2003 box, and it's giving me "The...
    5. "Start" "Program" "Menu" list is empty
      For what ever reason my list of installed programs in my "Start" "Programs" menu is empty. Anyone know how to restore the list. Thanks for your...
  3. #2

    Default Re: Jmail only sending "body" in first run of loop

    I have set up a test page to debug my problem and it seems the the database is
    only letting me use the binding called 'body' once where as it is happy to let
    me use others more than once. please visit the following page to see
    [url]http://www.stelphick.com/distnews2.asp[/url] next to recipient would be the
    subscribers name and address plus the sent conformation message but i have code
    these out the code for now. at the bottom of the page i have wrote the
    following code TITLE1<%=(rs_news.Fields.Item('title').Value)%>TIT LE1<br />
    BODY1<%=(rs_news.Fields.Item('body').Value)%>BODY1 <br />
    TITLE2<%=(rs_news.Fields.Item('title').Value)%>TIT LE2<br />
    BODY2<%=(rs_news.Fields.Item('body').Value)%>BODY2 from looking at the above
    page you will see the second time the 'body' binding appears in the code (last
    line) it is not translated onto the page. This is the root of my problem
    because the jmail loop sends the body to the first recipient only. I have no
    idea why the 'body' binding can only be used once when this is not consistent
    with the other variables. Any feedback would be fantastic, even just
    brainstorming on a possible fix woiuld be great! Thanks in advance Barry

    baz0hara Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139