473,508 Members | 2,053 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

EMail body HTML code-- ERROR

2 New Member
Hi All,
I am getting this error Microsoft VBScript compilation error '800a0401'

Expected end of statement

the code is:
Expand|Select|Wrap|Line Numbers
  1. objCDOMail.HTMLBody  = "<table border=""0"" width=""100%" "cellspacing=""0" "cellpadding=""0"">""<tr>""<td colspan=""4"">""<p align=""center""><font color=#330066 face=""Verdana" "size=""2""><b><u>""The Rate Request details from the Website </u></b></font></td>""</tr>""<tr>""<td width=""25%"">&nbsp;</td>""<td width=""16%"">&nbsp;</td>""<td width=""4%"">&nbsp;</td>""<td width=""52%"">&nbsp;</td>""</tr>""<tr>""<td width=""25%"">&nbsp;</td>""<td width=""16%"" align=""right""><i><b><font face=""Verdana""size=""2"">Name:</font></b></i></td>""<td width=""4%"">&nbsp;</td>""<td width=""52%""align=""left"">"& firstName &"</td>""</tr>""<tr>""<td width=""25%"">&nbsp;</td>""<td width=""16%" "align=""right"">&nbsp;</td>""<td width=""4%"">&nbsp;</td>""<td width=""52%" "align=""left"">&nbsp;</td>""</tr>"    "<tr>""<td width=""25%"">&nbsp;</td>""<td width=""16%" "align=""right""><i><b><font face=""Verdana" "size=""2"">"        "Company Name:</font></b></i></td>""<td width=""4%"">&nbsp;</td>""<td width=""52%" "align=""left"">"& lastName &"</td>"    "</tr>""<tr>""<td width=""25%"">&nbsp;</td>""<td width=""16%" "align=""right"">&nbsp;</td>""<td width=""4%"">&nbsp;</td>""<td width=""52%" "align=""left"">&nbsp;</td>""</tr>""<tr>""<td width=""25%"">&nbsp;</td>"        "<td width=""16%" "align=""right""><i><font face=""Verdana" "size=""2""><b>Email:</b></font></i></td>"        "<td width=""4%"">&nbsp;</td>""<td width=""52%" "align=""left"">"& street1 &"</td>""</tr>""<tr>""<td width=""25%"">&nbsp;</td>""<td width=""16%" "align=""right"">&nbsp;</td>""<td width=""4%"">&nbsp;</td>""<td width=""52%" "align=""left"">&nbsp;</td>""</tr>""<tr>""<td width=""25%"">&nbsp;</td>""<td width=""16%" "align=""right""><i><font face=""Verdana" "size=""2""><b>Phone ""Number: </b></font></i></td>""<td width=""4%"">&nbsp;</td>""<td width=""52%" "align=""left"">"& street2 &"</td>""</tr>""<tr>""<td width=""25%"">&nbsp;</td>"        "<td width=""16%" "align=""right"">&nbsp;</td>""<td width=""4%"">&nbsp;</td>""<td width=""52%"" align=""left"">&nbsp;</td>""</tr>""<tr>""<td width=""25%"">&nbsp;</td>""<td width=""16%" "align=""right""><i><b><font face=""Verdana" "size=""2"">""Message:</font></b></i></td>""<td width=""4%"">&nbsp;</td>""<td width=""52%"" align=""left"">"& town &"</td>""</tr>""</table>""
  2.  
I know it sucks........

If anyone has the patience to go thru and tell me where I am making the mistake.


Thanks for your patience and answer

Aru
Dec 5 '07 #1
1 1024
jhardman
3,406 Recognized Expert Specialist
Aru,

1- split this up into multiple lines
2- get a better method for handling quote marks - HTML will accept single quotes usually, if that doesn't work, use the character code chr(34)
Making those two changes will solve all your problems.
Expand|Select|Wrap|Line Numbers
  1. dim myText, q
  2. q = chr(34)
  3. myText = "<table border=" & q & "0" & q 
  4. myText = myText & " width=" & q & "100%" & q
  5. myText = myText & " cellspacing=" & q & "0" & q
  6. myText = myText & " cellpadding="& q & "0" & q
  7. myText = myText & "><tr><td colspan=" & q & "4" & q & ">"
  8. 'etc
  9. objCDOMail.HTMLBody  = myText
  10.  
some email components also allow sending premade HTML pages as email bodies, you just need to send a reference. You are using CDOSYS, rioght? You should be able to do that if it is convenient to do. Let me know if this helps.

Jared
Dec 6 '07 #2

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

Similar topics

2
2079
by: William Gower | last post by:
I am creating an email message to be sent from a web page. How do I embed variables like strFirstName, strLastName etc. into the body I would like it to say. Last Name : strLastName ...
3
1874
by: Axel Gallus | last post by:
I wrote a javascript function which should return the html code between a frame's body tag: function load_frame_as_string( Framename ) { var Frame =...
0
1540
by: Hamayun Khan | last post by:
Salam Reading email from mailserver return some extra character like 3D =20 = following is the mail body i read from mailserver through php code <HTML><HEAD>
1
2858
by: cnixuser | last post by:
Hello, I am having a problem that I believe is related to the way a stream reader object looks for a text file by default. What I am doing is using a StreamReader object to read the text of a text...
1
2805
by: neovantage | last post by:
Hey, I have read an email template and sending emails through php mail function. It shows html code when i open that received email in outlook express but it shows normal content in hotmail, yahoo,...
10
7377
dj12345
by: dj12345 | last post by:
Hi, (Asp.net + Ajax) I am creating a page which will fetch data from server without postbak of a page.. I have 2 controls on this page TextBox and Lable. I have assigned TextBoxWatermark...
4
4249
by: swethak | last post by:
Here mentioned my html code .When i opened the below code then it can redirected to the new php page as quiz_start.php . Now my requirement is i want to set the background color quiz_start.php in...
1
1512
by: Pat Gibson | last post by:
Hello all, I am very new to web design but am learning as I go so here goes with my problem... I have a website on Ucoz (which I paid for) and the site looks ok but I am having problems locating the...
18
4740
by: amritpalpathak | last post by:
I have made the html+javascript code.According to which when the page loaded the image size gets reduced to 50,50 and onclicking on it ,size increases to 500,500,but i done it with the one copy of ...
0
7125
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...
0
7328
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7388
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7499
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5631
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5055
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4709
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3199
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3186
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.