vb6 email formatted as html creating lines

Here is the code for building the string to email. It creates white blank lines of two different sizes throughout the report. The actual email is behind a firewall, but i'd be happy to send someone a jpeg of it if they wish.

I notice it happens after the 4th roll through, and then then 8th.


stremailmessage = "<HTML><HEAD></HEAD><BODY><h2>Locations not working for " & Date & "<h2>" & "<BR>"
stremailmessage = stremailmessage & "<font face = ""Arial"" size = 1><table border=""1"" cellpadding=""0"" cellspacing=""0"" style=""border-collapse: collapse"" bordercolor=""#111111"" width=""100%"" id=""AutoNumber1"">"
stremailmessage = stremailmessage & "<tr><td width=""10%""><font size ""1"">Counter</font></td><td width=""20%""><font size ""1"">Location Name</font></td><td width=""20%""><font size ""1"">City</font></td>"
stremailmessage = stremailmessage & "<td width=""20%""><font size ""1"">Connection Type</font></td><td width=""20%""><font size ""1"">Machine Name</font></td><td width=""30%""><font size ""1"">Last Connected</font></td>"
stremailmessage = stremailmessage & "<td width=""20%""><font size ""1"">Connection Time</font></td><td width=""20%""><font size ""1"">Hours Since Last Connection</font></td></tr></font>"

stremailmessage = stremailmessage & "<td width=""10%"" bgcolor = """ & strHolder & """>" & Counter & "</td>"
            stremailmessage = stremailmessage & "<td width=""20%"" bgcolor = """ & strHolder & """>" & AdoRec("Location Identifier") & "<font size = ""1""></font>&nbsp;</td>"
            stremailmessage = stremailmessage & "<td width=""20%"" bgcolor = """ & strHolder & """>" & AdoRec("Location City") & "</td>"
            stremailmessage = stremailmessage & "<td width=""20%"" bgcolor = """ & strHolder & """>" & AdoRec("Connection Type") & "</td>"
            stremailmessage = stremailmessage & "<td width=""20%"" bgcolor = """ & strHolder & """>" & AdoRec("Machine Name") & "</td>"
            stremailmessage = stremailmessage & "<td width=""30%"" bgcolor = """ & strHolder & """>                 stremailmessage = stremailmessage & AdoRec1("Date") & " - " & AdoRec1("Time")
            Else
                stremailmessage = stremailmessage & "N/A"
            End If
            stremailmessage = stremailmessage & "</td><td width=""20%"" bgcolor = """ & strHolder & """>"
            If AdoRec("Connection Type") = "BroadBand" Then
                    stremailmessage = stremailmessage & AdoRec("Machine Interval Time") & " Hours"
            Else
                    stremailmessage = stremailmessage & AdoRec("Machine Update Time")
            End If
            stremailmessage = stremailmessage & "</td><td width=""20%"" bgcolor = """ & strHolder & """>"
            If Not AdoRec1.EOF Then
                stremailmessage = stremailmessage & intHours & " hours"
            Else
                stremailmessage = stremailmessage & "N/A"
            End If
            stremailmessage = stremailmessage & "</td></tr>"
            stremailmessage = stremailmessage & "</Table></Body></HTML>"
intertiseAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

PreeceCommented:
One thing that I noticed is that it appears that you have forgotten an opening <tr> tag:

stremailmessage = "<HTML><HEAD></HEAD><BODY><h2>Locations not working for " & Date & "<h2>" & "<BR>"
stremailmessage = stremailmessage & "<font face = ""Arial"" size = 1><table border=""1"" cellpadding=""0"" cellspacing=""0"" style=""border-collapse: collapse"" bordercolor=""#111111"" width=""100%"" id=""AutoNumber1"">"
stremailmessage = stremailmessage & "<tr><td width=""10%""><font size ""1"">Counter</font></td><td width=""20%""><font size ""1"">Location Name</font></td><td width=""20%""><font size ""1"">City</font></td>"
stremailmessage = stremailmessage & "<td width=""20%""><font size ""1"">Connection Type</font></td><td width=""20%""><font size ""1"">Machine Name</font></td><td width=""30%""><font size ""1"">Last Connected</font></td>"
stremailmessage = stremailmessage & "<td width=""20%""><font size ""1"">Connection Time</font></td><td width=""20%""><font size ""1"">Hours Since Last Connection</font></td></tr></font>"

<!-- here is where the <tr> should be -->

stremailmessage = stremailmessage & "<td width=""10%"" bgcolor = """ & strHolder & """>" & Counter & "</td>"
...

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
intertiseAuthor Commented:
yes I realized that after as well. However it didnt change the problem. I'll try to validate it right now.
PreeceCommented:
I guess it would help if you could post a jpeg...
Your Guide to Achieving IT Business Success

The IT Service Excellence Tool Kit has best practices to keep your clients happy and business booming. Inside, you’ll find everything you need to increase client satisfaction and retention, become more competitive, and increase your overall success.

edwardiiiCommented:
Hi, intertise.

I noticed a missing quote mark after:

stremailmessage = stremailmessage & "<td width=""30%"" bgcolor = """ & strHolder & """> . Beyond that, as long as each "stremailmessage = stremailmessage &" statement follows the & with text surrounded by quotes, you should get what you need.

edwardiiiCommented:
Also, in the same line I mentioned above with the missing quote, hit Enter to create a new line. Currently it is:

stremailmessage = stremailmessage & "<td width=""30%"" bgcolor = """ & strHolder & """>                 stremailmessage = stremailmessage & AdoRec1("Date") & " - " & AdoRec1("Time")
Should be:

stremailmessage = stremailmessage & "<td width=""30%"" bgcolor = """ & strHolder & """>"
stremailmessage = stremailmessage & AdoRec1("Date") & " - " & AdoRec1("Time")

And following this code you have:

Else
       stremailmessage = stremailmessage & "N/A"
End If

We need the intial If statement to proceed this...
edwardiiiCommented:
Typo, meant "precede this..."
HenkLCommented:
Can you post the whole lot of the code? Maybe then I can replace it by better code.
You could try Chr(34) instead of " in the string.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Fonts Typography

From novice to tech pro — start learning today.