![]() |
| |||||||
| Sponsored Links |
![]() | « Previous Thread | Next Thread » |
| | LinkBack | Thread Tools | Display Modes |
|
#1
| ||||
| ||||
| Hi all, I need to know how to write the html page into CDOMail.HTMLBody. Is the code below correct : Code: Mailer.HTMLBody = "<table width="743" height="476" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="28"></td> <td width="704" align="left" class="style1"> <table width="704" height="30" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="100" align="left">Date</td> <td width="20" align="right"></td> <td align="left"><%=FormatDateTime(Date(),0)%></td> </tr>" |
| Sponsored Links |
|
#2
| ||||
| ||||
| You'll either have to double up all the double quotes inside the string or replace them with single quotes. EDIT::: here's a sample: Code: Mailer.HTMLBody = "<table width=""743"" height=""476"" border=""0"" cellpadding=""0"" cellspacing=""0""><tr><td width=""28""></td><td width=""704"" align=""left"" class=""style1""><table width=""704"" height=""30"" border=""0"" cellpadding=""0"" cellspacing=""0""><tr><td width=""100"" align='"left"">Date</td><td width="20" align="right"></td><td align=""left"">" & FormatDateTime(Date(),0) & "</td></tr>"
__________________ jmurrayhead If you agree with me... click the icon! If my post solved your problem, click the button in the lower right-hand corner of the post.Join our Folding team: DeveloperBarn Folding |
|
#3
| ||||
| ||||
| Hi flo, i think it looks ok...does it give you an error? only thing i do notice is...you don't have a close tag for table </table>. |
|
#4
| ||||
| ||||
| @ J : thx for the double quote @ Belle : I haven't tried it yet, I just want to make sure if the code is written correctly ![]() btw, does anyone know how to make it more simple? coz it will be a long html code T__T |
|
#5
| ||||
| ||||
| For long HTML strings, you can use concatenation to make it look more clean: Code: "<table>" & _ "<tr><td>Cell 1</td><td>Cell 2</td></tr>" & _ "</table>" |
| The Following User Says Thank You to jmurrayhead For This Useful Post: | ||
PhloooooIsFlo (August 13th, 2008) | ||
|
#6
| ||||
| ||||
| Awrite.. i will try this Hope it works tomorrow morning at work ^^ |
|
#7
| ||||
| ||||
| Hi all, i'm having a problem with some asp code inside the html code i want to put into the HTMLBody... I confused how to write the code... for example : Code:
"<table width='704'>"&_
i = 1
While Not rscart.EOF
"<tr>"&_
"<td align='center' width='50' height='50'>" & i & "</td>"&_
"<td align='center' width='200' height='50'>"&_
strSQL = 'SELECT * FROM ProductCategory WHERE ProductCategoryID = ' & rscart('ProductCategory')
rss.Open strSQL, db, 3, 3
If Not rss.EOF Then Response.Write(rss('ProductCategoryName') & ' ')
rss.Close
If rscart('ProductCategory') <> 17 Then
strSQL = 'SELECT * FROM ProductD WHERE ProductID = ' & rscart('ProductID') & ' AND ProductDID = ' & rscart('ProductDID')
rss.Open strSQL, db, 3, 3
If Not rss.EOF Then
Response.Write(rss('ProductName') & ' / ' & rss('ProductCode'))
If Trim(rss('ProductCodeDetail')) <> '' Then Response.Write('.' & rss('ProductCodeDetail'))
If Trim(rss('Note')) <> '' Then Response.Write(' ' & rss('Note'))
End If
rss.Close
Else
strSQL = 'SELECT * FROM OtherFabric WHERE FabricID = ' & rscart('ProductID')
rss.Open strSQL, db, 3, 3
If Not rss.EOF Then
Response.Write(rss('Folder') & ' ' & Trim(rss('FabricCode')))
End If
rss.Close
End If
"</td>"&_
1. Is it possible to put both textBody and HTMLBody together? Coz i've tried this once and the body (content of the mail) is blank. 2. I've search about sending a page using HTMLBody, i put the code Code: Mailer.CreateMHTMLBody "http://www.xxxxxxxx.com/confirm.asp" Microsoft VBScript compilation error '800a0401' Expected end of statement /thank_you.asp, line 113 Mailer.CreateMHTMLBody "http://www.xxxxxxxxxx.com/confirm.asp" -----------------------^ Thx Last edited by PhloooooIsFlo; August 14th, 2008 at 12:29 AM. Reason: add more question |
|
#8
| ||||
| ||||
| sorry, i dont understand what u asking here?? u need to build a string, and honestly u write the code and see how it goes. about putting both textBody and HTMLBody together, i really dont know. have a look at this link, see if it helps How do I send e-mail in HTML format? regarding CreateMHTMLBody, it looks fine, u can see here ASP Sending e-mail with CDOSYS may be u shud post more code. |
|
#9
| ||||
| ||||
| Quote:
|
|
#10
| ||||
| ||||
| Quote:
|
![]() |
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|