Hi,
I have a mystery to solve. It is a mystery because it happens randomly.
In the ASP page that is in question, I build a large string (no more
than 10K) which is basically an email template in HTML format. Then I
replace the parts with the values, which are also strings with the size
of 1-2 KB.
For example:
order_summary = generateOrderSummary() 'This HTML string is no more
than 4-5 KB
send_email (order_summary, to_sales_department) 'This email goes to
sales dept, they receive it OK.
email_body = readFromFile("HTML_email_template.html") ' This is 10KB
email_body = replace (email_body, "<!-- NAME -->", billing_name)
email_body = replace (email_body, "<!-- ORDER SUMMARY -->",
order_summary)
email_body = replace (email_body, "<!-- OTHER -->", other_stuff)
send_email (email_body, to_customer) ' They sometimes receive trimmed
order summary.
Here is the mystery: sometimes recipients complain that their order
confirmation is wrong because it seems order_summary part is trimmed.
They fw me the email and yes it was trimmed, however the rest of the
email is OK: just the order_summary in the middle of the email was
messed up. Since order_summary shows OK on the first email, and not on
the second email I concluded that there must be something with the
replace function. It doesn't happen a lot, there are only 2 known cases
out of couple thousands. It is not order-specific either, I place the
same order and order_summary shows OK.
Any suggestions on how to isolate the problem?
Have you encountered the same/similar problems with strings?
I use ASP 3.0 on IIS 6.0. Server is Windows 2003.
Thanks
Deniz 7 1902
"denoxis" <go****@deniznet.comwrote in message
news:11*********************@s34g2000cwa.googlegro ups.com...
Hi,
I have a mystery to solve. It is a mystery because it happens randomly.
In the ASP page that is in question, I build a large string (no more
than 10K) which is basically an email template in HTML format. Then I
replace the parts with the values, which are also strings with the size
of 1-2 KB.
For example:
order_summary = generateOrderSummary() 'This HTML string is no more
than 4-5 KB
send_email (order_summary, to_sales_department) 'This email goes to
sales dept, they receive it OK.
email_body = readFromFile("HTML_email_template.html") ' This is 10KB
email_body = replace (email_body, "<!-- NAME -->", billing_name)
email_body = replace (email_body, "<!-- ORDER SUMMARY -->",
order_summary)
email_body = replace (email_body, "<!-- OTHER -->", other_stuff)
send_email (email_body, to_customer) ' They sometimes receive trimmed
order summary.
Here is the mystery: sometimes recipients complain that their order
confirmation is wrong because it seems order_summary part is trimmed.
They fw me the email and yes it was trimmed, however the rest of the
email is OK: just the order_summary in the middle of the email was
messed up. Since order_summary shows OK on the first email, and not on
the second email I concluded that there must be something with the
replace function. It doesn't happen a lot, there are only 2 known cases
out of couple thousands. It is not order-specific either, I place the
same order and order_summary shows OK.
Any suggestions on how to isolate the problem?
Have you encountered the same/similar problems with strings?
It has been known that if the html body part of the email is not encoded
using quoted-printable encoding that white space gets inserted into html tag
names. When that happens the html output gets messed up.
I use ASP 3.0 on IIS 6.0. Server is Windows 2003.
Thanks
Deniz
denoxis wrote:
Any suggestions on how to isolate the problem?
Have you encountered the same/similar problems with strings?
What happens when you change this...
email_body = replace (email_body, "<!-- ORDER SUMMARY -->",
order_summary)
....to this?
email_body = replace(email_body, "<!-- ORDER SUMMARY -->",
Server.HTMLEncode(order_summary))
--
Dave Anderson
Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.
If I do that I see the HTML source in the email! Doesn't HTMLEncode
change "<" to < and ">" to > etc? I don't want that, my email
*is* in HTML, I want to keep the tags so my email would be formatted
accordingly.
Deniz
Dave Anderson wrote:
denoxis wrote:
Any suggestions on how to isolate the problem?
Have you encountered the same/similar problems with strings?
What happens when you change this...
email_body = replace (email_body, "<!-- ORDER SUMMARY -->",
order_summary)
...to this?
email_body = replace(email_body, "<!-- ORDER SUMMARY -->",
Server.HTMLEncode(order_summary))
--
Dave Anderson
Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.
denoxis wrote:
> email_body = replace(email_body, "<!-- ORDER SUMMARY -->", Server.HTMLEncode(order_summary))
If I do that I see the HTML source in the email! Doesn't HTMLEncode
change "<" to < and ">" to > etc? I don't want that, my email
*is* in HTML, I want to keep the tags so my email would be formatted
accordingly.
Right. But you did not try, so you did not find out if your content is
actually present.
I made the suggestion so you could determine whether you were simply guilty
of writing sloppy HTML in the affected section. NOT VISIBLE does not equal
NOT THERE when it comes to HTML, after all. I suppose you can still [view
source] on the offending messages if you want to know for sure.
--
Dave Anderson
Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.
Dave Anderson wrote:
denoxis wrote:
email_body = replace(email_body, "<!-- ORDER SUMMARY -->",
Server.HTMLEncode(order_summary))
If I do that I see the HTML source in the email! Doesn't HTMLEncode
change "<" to < and ">" to > etc? I don't want that, my email
*is* in HTML, I want to keep the tags so my email would be formatted
accordingly.
Right. But you did not try, so you did not find out if your content is
actually present.
I appreciate the suggestion, I did try it before I post my answer and
that's what I saw: piece of HTML source code in the middle of HTML
email, which would show correctly if it was real HTML. I thought you
suggested that those codes would translate back to normal HTML in the
email.
I made the suggestion so you could determine whether you were simply guilty
of writing sloppy HTML in the affected section. NOT VISIBLE does not equal
NOT THERE when it comes to HTML, after all. I suppose you can still [view
source] on the offending messages if you want to know for sure.
Sloppy HTML is less likely since it is generated in a loop for each
product. Something like:
....
"<tr><td>" & product_name & "</td><td>" & price & "</td><td>" & qty &
"</td></tr>"
....
I did make sure product names don't contain weird characters (such as <
and >) By looking at the source code of the email that is in question,
I see part of the HTML is missing with no trace
I did however one thing: adding linebreaks in the HTML-generating loop
(otherwise there could be a very long line depending on the order size,
which is actually reason of some of the bounce-backs) So maybe it is
line-length related issue. We will see if adding '& vbcrlf' to the end
of the code above helps.
Thanks for the answers
Deniz
>
--
Dave Anderson
Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.
"denoxis" <go****@deniznet.comwrote in message
news:11**********************@v45g2000cwv.googlegr oups.com...
>
Dave Anderson wrote:
denoxis wrote:
> email_body = replace(email_body, "<!-- ORDER SUMMARY -->",
> Server.HTMLEncode(order_summary))
>
If I do that I see the HTML source in the email! Doesn't HTMLEncode
change "<" to < and ">" to > etc? I don't want that, my email
*is* in HTML, I want to keep the tags so my email would be formatted
accordingly.
Right. But you did not try, so you did not find out if your content is
actually present.
I appreciate the suggestion, I did try it before I post my answer and
that's what I saw: piece of HTML source code in the middle of HTML
email, which would show correctly if it was real HTML. I thought you
suggested that those codes would translate back to normal HTML in the
email.
I made the suggestion so you could determine whether you were simply
guilty
of writing sloppy HTML in the affected section. NOT VISIBLE does not
equal
NOT THERE when it comes to HTML, after all. I suppose you can still
[view
source] on the offending messages if you want to know for sure.
Sloppy HTML is less likely since it is generated in a loop for each
product. Something like:
...
"<tr><td>" & product_name & "</td><td>" & price & "</td><td>" & qty &
"</td></tr>"
...
I did make sure product names don't contain weird characters (such as <
and >) By looking at the source code of the email that is in question,
I see part of the HTML is missing with no trace
I did however one thing: adding linebreaks in the HTML-generating loop
(otherwise there could be a very long line depending on the order size,
which is actually reason of some of the bounce-backs) So maybe it is
line-length related issue. We will see if adding '& vbcrlf' to the end
of the code above helps.
Have you yet confirmed whether the HTML body part is being encoded as
quoted-printable. I said this already but you didn't respond. If you
haven't you could well save yourself a lot of time but just checking. It is
the most likely cause of your problem.
Anthony,
I am sorry, I didn't read the answer carefully, I thought you were
suggesting the same thing. Actually you may be pointing out to the core
of the problem. I thought these kind of encodings were done
automatically by the email sender component, however I just checked the
reference for it and it says I have to set ContentTransferEncoding
property to "quoted-printable" to have quoted-printable. So I will
definitely try that.
Thanks for the followup!!!
Deniz
Anthony Jones wrote:
>
Have you yet confirmed whether the HTML body part is being encoded as
quoted-printable. I said this already but you didn't respond. If you
haven't you could well save yourself a lot of time but just checking. It is
the most likely cause of your problem.
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: higabe |
last post by:
Three questions
1)
I have a string function that works perfectly but according to W3C.org
web site is syntactically flawed because it contains the characters </
in sequence. So how am I...
|
by: Les Juby |
last post by:
A client needs a routine to alert him as to which memo records in an
Access-2000 database have had double apostrophes inserted in the text.
These are stopping a Java mouseover from executing.
...
|
by: nboutelier |
last post by:
Scenario: you enter "foo bar" into a text field... Is it possible
through javascript to select/highlight just "foo"?
formObject.select()
selects all. I need to select only part of the string....
|
by: dimitris67 |
last post by:
How can I replace an occurence of p(a string) in an other string(s) with
np(new string)..
char* replace _pattern(char *s,char *p,char *np)
PLEASE HELP ME!!!!!
|
by: Paul |
last post by:
hi, there,
for example,
char *mystr="##this is##a examp#le";
I want to replace all the "##" in mystr with "****". How can I do this?
I checked all the string functions in C, but did not...
|
by: Jeff S |
last post by:
In a VB.NET code behind module, I build a string for a link that points to a
JavaScript function. The two lines of code below show what is relevant.
PopupLink = "javascript:PopUpWindow(" &...
|
by: djc |
last post by:
I need to prepare a large text database field to display in an asp.net
repeater control. Currently I am replacing all chr(13)'s with a "<br/>" and
it works fine. However, now I also want to be able...
|
by: ^MisterJingo^ |
last post by:
Hi all,
I have a variable called root which contains
(E:\Web\Websites\fileBrowse\) and then I have a variable called path
which uses root, and adds directories on to it (this is part of a file...
|
by: TC |
last post by:
Hey All,
I have strings in currency. For example: "$1.29"
What is the best way to convert them to decimal formatted like: "1.29"
Thanks,
TC
|
by: DJRhino |
last post by:
Was curious if anyone else was having this same issue or not....
I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM)
The start time is equivalent to 19:00 (7PM) in Central...
|
by: giovanniandrean |
last post by:
The energy model is structured as follows and uses excel sheets to give input data:
1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
|
by: Teri B |
last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course.
0ne-to-many. One course many roles.
Then I created a report based on the Course form and...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM)
Please note that the UK and Europe revert to winter time on...
|
by: nia12 |
last post by:
Hi there,
I am very new to Access so apologies if any of this is obvious/not clear.
I am creating a data collection tool for health care employees to complete. It consists of a number of...
|
by: NeoPa |
last post by:
Introduction
For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
|
by: isladogs |
last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, Mike...
|
by: GKJR |
last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...
| |