473,386 Members | 1,630 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Table in a HTML mail

142 100+
Hi,

I'm trying to send a table in my e-mail but having problems with the " and '

I don't know ASP so please tel mehow do I fix this probles.

here is what I want to do (piece of the code), The problem is with the width and border's " ".

-------------------------------

Expand|Select|Wrap|Line Numbers
  1. myMail.HTMLBody = "<table width="400" border="1">
  2.   <tr>
  3.     <td>sample text</td>
  4.     <td>sample text</td>
  5.   </tr>
  6.   <tr>
  7.     <td>sample text</td>
  8.     <td>sample text</td>
  9.   </tr>
  10. </table>"
Sep 10 '08 #1
4 1740
DrBunchman
979 Expert 512MB
Hi webandwe,

Inside a string (which is delimited by double quotes) you can use single quotes to mark the beginning and end of html properties. Also, it is easier to build your html body as a string variable and then assign that to the mail object property.

Here's an example using your code above:

Expand|Select|Wrap|Line Numbers
  1. Dim sBody
  2. sBody = "<table width='400' border='1'>"
  3. sBody = sBody & "<tr>"
  4. sBody = sBody & "<td>sample text</td>"
  5. sBody = sBody & "<td>sample text</td>"
  6. sBody = sBody & "</tr>"
  7. sBody = sBody & "</table>"
  8.  
  9. myMail.HTMLBody =  sBody
Does this make sense? Let me know,

Dr B
Sep 11 '08 #2
omerbutt
638 512MB
Hi webandwe,

Inside a string (which is delimited by double quotes) you can use single quotes to mark the beginning and end of html properties. Also, it is easier to build your html body as a string variable and then assign that to the mail object property.

Here's an example using your code above:

Expand|Select|Wrap|Line Numbers
  1. Dim sBody
  2. sBody = "<table width='400' border='1'>"
  3. sBody = sBody & "<tr>"
  4. sBody = sBody & "<td>sample text</td>"
  5. sBody = sBody & "<td>sample text</td>"
  6. sBody = sBody & "</tr>"
  7. sBody = sBody & "</table>"
  8.  
  9. myMail.HTMLBody =  sBody
Does this make sense? Let me know,

Dr B
of course you should use this technique to concatinate the table into the mail body ....this is the more managed and precised method any one can tell what the code is doing by just a glimpse of it.
Sep 11 '08 #3
webandwe
142 100+
Hi,

Thanks I'll do it that way. In PHP I created the table, paste and swap the ' " around.

The reason I ask was because I have one huge form. 101 fields. (really 101).

Thanks all.
Sep 11 '08 #4
omerbutt
638 512MB
Hi,

Thanks I'll do it that way. In PHP I created the table, paste and swap the ' " around.

The reason I ask was because I have one huge form. 101 fields. (really 101).

Thanks all.
sure webandwe,
you are welcome any time :)
regards,
Omer Aslam
Sep 12 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: yurps | last post by:
Hello here is my html, if you click the missing image in the first column on the left, the div is shown, when clicked again the div disappears...but the bottom border disappears as well...Is there...
7
by: Brett | last post by:
I'm generating a table that displays all links in an email message. Some may have many links, which creates a very long table. Each link uses a row. It may take five seconds or more to display...
11
by: Hemant Shah | last post by:
Folks, I have a perl script that creates and uses global termporary table. This script worked fine with UDB 7.2 on AIX. Sometime ago I moved the database to UDB 8 on Linux. The select statement...
10
by: Hemant Shah | last post by:
Folks, I am using DB2 UDB 8.1 on RedHat ES 2.1. In order to improve performance of one of our table, I would like to preload some or all of the data into memory when I start DB2. Is there a...
3
by: Aur_Ros | last post by:
I am showing a table in a web page, I need help to email this table, please any sugestion ....? thanks!!
9
by: Hemant Shah | last post by:
How do I find out when the table was modified? When I look at syscat.tables it only lists creation time. -- Hemant Shah /"\ ASCII ribbon campaign E-mail:...
4
by: Hemant Shah | last post by:
Folks, Our client has a program that browses whole table from begining to end. The table has 1 million rows in it. REORGCHK does not show any problems. It has unique index defined on KEY0...
5
by: Troels Arvin | last post by:
Hello, Every so often, I'm asked to help people recover data from tables that were either dropped or where to much data was DELETEed. The complications related to restoring data are a problem....
5
by: Romulo NF | last post by:
Greetings, I´m back here to show the new version of the drag & drop table columns (original script ). I´ve found some issues with the old script, specially when trying to use 2 tables with...
2
by: Kirk Strauser | last post by:
Short question: Is there a good library for generating HTML-style tables with the equivalent of colspans, automatically sized columns, etc. that can render directly to PDF? Longer question: ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.