View Full Version : HELP Real good one with cdo.Message!
netvbonline
12-14-2005, 02:09 PM
Hi,
I am really stumped here :-). Basically when I send a *PLAIN/HTML" email using the cdo.Message component via ASP.Net everything is seemingly ok.
However the moment you view the received email in Outlook 200 SR-1 there is an extremely annoying " ! " char and a carriage return escape or something following it.
I'm not formatting the text, its just plain old text format, what you see is what you dont get :-)
I've sent the same email to different PC's and it happens on both client machines.
But in yahoo mail that character does not appear. I've done loads of trial and error tests and seem to identified a pattern.
Basically the position of the rogue character is not fixed, it changes based on the content... not on the number of chars/lines in the message and not even the message format.
The code is below, i'd be very grateful if somebody could re-create the problem.
<% Option Explicit %>
<%
strEmailTo="your email address"
strEmailFrom="from header who's it from email etc"
strEmailSubject="rogue char"
strEmailBody="aaaaaazgeklscejnlziralicswxwyrorhnnuwxtgokctuftvbhryslykjxowqsfsxuecoylhfltalfkvtijzjmqlafgfhswzpvuc fgbowskbcnaekjzhtthlrgpfranagcmephmpntbjnnsebqriluytjhhgiaeiqeclgieqftskeojfmriibbptzoxnziojhenmxpux vbkkvvamcrzpschbropoqjgjymfmoqmymbusmwrnuyqqkcqbipgpikwqpmvugqcgeklscejnlziralicswxwyrorhnnuwxtgokct uftvbhryslykjxowqsfsxuecoylhfltalfkvtijzjmqlafgfhswzpvucfgbowskbcnaekjzhtthlrgpfranagcmephmpntbjnnse bqriluytjhhgiaeiqeclgieqftskeojfmriibbptzoxnziojhenmxpuxvbkkvvamcrzpschbropoqjgjymfmoqmymbusmwrnuyqq kcqbipgpikwqpmvugqcgeklscejnlziralicswxwyrorhnnuwxtgokctuftvbhryslykjxowqsfsxuecoylhfltalfkvtijzjmql afgfhswzpvucfgbowskbcnaekjzhtthlrgpfranagcmephmpntbjnnsebqriluytjhhgiaeiqeclgieqftskeojfmriibbptzoxn ziojhenmxpuxvbkkvvamcrzpschbropoqjgjymfmoqmymbusmwrnuyqqkcqbipgpikwqpmvugqcgeklscejnlziralicswxwyror hnnuwxtgokctuftvbhryslykjxowqsfsxuecoylhfltalfkvtijzjmqlafgfhswzpvucfgbowskbcnaekjzhtthlrgpfranagcme phmpntbjnnsebqriluytjhhgiaeiqeclgieqftskeojfmriibbptzoxnziojhenmxpuxvbkkvvamcrzpschbropoqjgjymfmoqmy"
Call SendEmailText(strEmailTo, strEmailFrom, strEmailSubject, strEmailBody)
Public Sub SendEmailText(sTo, sFrom, sSubject, sBody)
dim objCDOMail
dim sHTML
set objCDOMail = server.CreateObject("CDO.Message")
objCDOMail.From = sFrom
objCDOMail.To = sTo
objCDOMail.BCC = "anyone@email.com
objCDOMail.Subject = sSubject
objCDOMail.TextBody = sBody
objCDOMail.Send
Response.write "<br><br><b>SendEmail: Sent email to " & sTo & " - " & sSubject & "<br><br></b>"
response.write "<b>the body is <br><br>" & sBody
Set objCDOMail = Nothing
end sub
%>
The code is running on a very powerful dedicated server, I cant think of any reason why it would not be up to date with patches etc?
Thanks guys. :thumbsup:
netvbonline
12-14-2005, 03:35 PM
hi guys,
have any of you been able to try the code out yet? At this stage it would be nice to know i'm not the only person experencing this weird problem :-))
If I was to send a simple "hello this is an email" it would work perfectly every time, it seems the moment you want to send more chars say 300 it starts to happen.
cheers for any help you can offer ..:)
netvbonline
12-14-2005, 03:46 PM
please help guys, ideas would be really good as i'm completely out of them :-)) I feel like a classic numpty, its the not knowing part that really gets ya !
BarrMan
12-14-2005, 03:56 PM
Stop spamming the thread! if someone knows what's the answer he'll probably help you...
TheShaner
12-14-2005, 04:26 PM
First of all, there is a ASP.NET forum that this should have been posted in.
Second, bumping your thread will not get someone to answer you quicker. If someone can help you, they will; so just be patient.
Third, your code looks fine. I've used CDO mail for ASP (not ASP.NET) and viewed it in Outlook 2003 just fine. It's also had a message body with more than 300 characters and it's sent as text, just as yours is, so I'm not sure why you'd get the strange characters. Do they appear in your message body? In the subject? Where?
Also, I'm hoping that you're just leaving out some stuff, like Dimming variables just to keep the code short in your post, because you use an Option Explicit, which means all variables must be declared.
Another thing I noticed is that you said "PLAIN/HTML". Which is it? If you want only plain text, then you use MailObject.TextBody = "blah". If you have HTML in your message then you must use MailObject.HTMLBody = "<b>blah</b>"
Clean up your code like this and see what you get:
<%Option Explicit%>
<%
Dim strEmailTo, strEmailFrom, strEmailSubject
strEmailTo="toaddress@email.com"
strEmailFrom="fromaddress@email.com"
strEmailSubject="My Subject"
strEmailBody="aaaaaazgeklscejnlziralicswxwyrorhnnuwxtgokctuftvbhryslykjxowqsfsxuecoylhfltalfkvtijzjm qlafgfhswzpvucfgbowskbcnaekjzhtthlrgpfranagcmephmpntbjnnsebqriluytjhhgiaeiqeclgieqftskeojfmriibbptzo xnziojhenmxpuxvbkkvvamcrzpschbropoqjgjymfmoqmymbusmwrnuyqqkcqbipgpikwqpmvugqcgeklscejnlziralicswxwyr orhnnuwxtgokctuftvbhryslykjxowqsfsxuecoylhfltalfkvtijzjmqlafgfhswzpvucfgbowskbcnaekjzhtthlrgpfranagc mephmpntbjnnsebqriluytjhhgiaeiqeclgieqftskeojfmriibbptzoxnziojhenmxpuxvbkkvvamcrzpschbropoqjgjymfmoq mymbusmwrnuyqqkcqbipgpikwqpmvugqcgeklscejnlziralicswxwyrorhnnuwxtgokctuftvbhryslykjxowqsfsxuecoylhfl talfkvtijzjmqlafgfhswzpvucfgbowskbcnaekjzhtthlrgpfranagcmephmpntbjnnsebqriluytjhhgiaeiqeclgieqftskeo jfmriibbptzoxnziojhenmxpuxvbkkvvamcrzpschbropoqjgjymfmoqmymbusmwrnuyqqkcqbipgpikwqpmvugqcgeklscejnlz iralicswxwyrorhnnuwxtgokctuftvbhryslykjxowqsfsxuecoylhfltalfkvtijzjmqlafgfhswzpvucfgbowskbcnaekjzhtt hlrgpfranagcmephmpntbjnnsebqriluytjhhgiaeiqeclgieqftskeojfmriibbptzoxnziojhenmxpuxvbkkvvamcrzpschbro poqjgjymfmoqmy"
Call SendEmailText(strEmailTo, strEmailFrom, strEmailSubject, strEmailBody)
Public Sub SendEmailText(sTo, sFrom, sSubject, sBody)
Dim objCDOMail
Set objCDOMail = Server.CreateObject("CDO.Message")
objCDOMail.From = sFrom
objCDOMail.To = sTo
objCDOMail.BCC = "anyone@email.com"
objCDOMail.Subject = sSubject
objCDOMail.TextBody = sBody
objCDOMail.Send
Response.Write "<br><br><b>SendEmail: Sent email to " & sTo & " - " & sSubject & "<br><br></b>"
Response.Write "<b>The body is:<br><br>" & sBody & "</b>"
Set objCDOMail = Nothing
End Sub
%>
-Shane
netvbonline
12-14-2005, 04:56 PM
Hi all,
Sorry didnt mean to spam or exert my frustration in my thread ;-)
Barrman ... do you have any suggestion with regards to the question asked?
Shane,
This code has been taken out as a snippet hence the typo .. one should indeed always declare there variables well spotted thankyou.
There is no difference between your example and the actual live code in my script, other than I remembered to declare my variables in the original.
The rogue chars appear in the body text .. also there should be no spaces between the chars in the strEmailBody variable (although it probably wont matter).
If you have run the same code and got no error then I am really puzzled, the version of outlook i'm using is 2000 SR-1 as opposed to Outlook 2003.
The message is going out as plain text right ?
thanks
TheShaner
12-14-2005, 05:04 PM
Yeah, I know mine wasn't any different from yours except the Dimming of the variables. But you said you have that in your original, so I'm not sure where to go from there.
Can you post exactly the format of the body message you get with the rogue characters included?
Yes, I've ran the same code, but I was using Outlook 2003 and didn't have any problems with it. My company has been using my code for over a month now and no problems. It is sent using plain text too.
Also, we aren't using ASP.NET, so I'm not sure about any difference between the two, which is why I suggested that you should've posted in the ASP.NET forums, for I don't have any experience with ASP.NET.
-Shane
netvbonline
12-14-2005, 05:16 PM
hi shane,
The message I receive in outlook 2K
aaaaaazgeklscejnlziralicswxwyrorhnnuwxtgokctuftvbhryslykjxowqsfsxuecoylhfltalfkvtijzjmqlafgfhswzpvuc fgbowskbcnaekjzhtthlrgpfranagcmephmpntbjnnsebqriluytjhhgiaeiqeclgieqftskeojfmriibbptzoxnziojhenmxpux vbkkvvamcrzpschbropoqjgjymfmoqmymbusmwrnuyqqkcqbipgpikwqpmvugqcgeklscejnlziralicswxwyrorhnnuwxtgokct uftvbhryslykjxowqsfsxuecoylhfltalfkvtijzjmqlafgfhswzpvucfgbowskbcnaekjzhtthlrgpfranagcmephmpntbjnnse bqriluytjhhgiaeiqeclgieqftskeojfmriibbptzoxnziojhenmxpuxvbkkvvamcrzpschbropoqjgjymfmoqmymbusmwrnuyqq kcqbipgpikwqpmvugqcgeklscejnlziralicswxwyrorhnnuwxtgokctuftvbhryslykjxowqsfsxuecoylhfltalfkvtijzjmql afgfhswzpvucfgbowskbcnaekjzhtthlrgpfranagcmephmpntbjnnsebqriluytjhhgiaeiqeclgieqftskeojfmriibbptzoxn ziojhenmxpuxvbkkvvamcrzpschbropoqjgjymfmoqmymbusmwrnuyqqkcqbipgpikwqpmvugqcgeklscejnlziralicswxwyror hnnuwxtgokctuftvbhryslykjxowqsfsxuecoylhfltalfkvtijzjmqlafgfhswzpvucfgbowskbcnaekjzhtthlrgpfranagcme phmpntbjnnsebqriluytjhhgiaeiqeclgieqftskeojfmriibbptzoxnziojhenmxpuxvbkkvvamcrzpschbropoqjg!
jymfmoqmy
I appreciate any help you may give, to be honest i'm not sure what version of asp i'm running :-)) I am new to ASP but have quite a strong development background not that its helping much at moment LOL.
In IIS, under extensions I have more than one version enabled .. I didnt write the site i'm currently working on and have no idea how you would determine the right version and whether or not the others should be disabled ??
:-)) that is such a newbie post ... (I know)
TheShaner
12-14-2005, 05:30 PM
So that one random exclamation mark is what you get? Nothing else? And it's just randomly inserted somewhere in your message? That's really strange.
When you print your message to the screen, it looks fine?
I would see if you can search around Microsoft Outlook and ASP problems on the web or something. I really don't know where to go from here, haha. Sorry!
-Shane
BarrMan
12-14-2005, 05:35 PM
its not randomally... this is what he wrote on the email body.
netvbonline
12-14-2005, 05:41 PM
hi shane,
The exclamation mark appears in different places, depending on the content. Sometimes, there is more than one exclamation mark and there doesnt appear to be any set pattern.
I've even counted the number of chars and lines to see if there is a pattern and could not determine one.
I tried searching the web first, and then finally came here. I'd let it go but these emails will be going to paying customers and I cant afford to have this strange behaviour.
Would you normally enable all of the asp extensions under IIS or not?
Cheers.
netvbonline
12-14-2005, 05:43 PM
Hi barrman,
>its not randomally... this is what he wrote on the email body.
Whats your point here ..? I did an exact copy and past from the original email to illustrate the problem.
At the moment there does not appear to be a pattern ..?
Do you have anything to add to my question ? have you tested the code etc
TheShaner
12-14-2005, 05:48 PM
Barrman, it is random. That's what he's saying. He doesn't put the exclamation mark in the message, but when someone receives the email, there will be random exclamation marks in the body of the message, but only when viewed in Outlook 2000 SR-1
netvbonline, to be honest, I didn't even touch the extensions on our server. I just put the ASP on our web server we have and it worked, haha. We're using Windows Server 2003. If I had complete access to it, I'd check now, but unfortunately I have to go through another tech in order to get access :/ What extensions are listed and selected?
-Shane
netvbonline
12-14-2005, 05:48 PM
Here's a better example, consider
ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijlkmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijlkmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijlkmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijlkmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijlkmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijlkmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijlkmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijlkmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijlkmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijlkmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijlkmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijlkmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijlkmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijlkmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijlkmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijlkmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijlkmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijlkmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRS!
TUVWXYZ abcdefghijlkmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijlkmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijlkmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijlkmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijlkmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijlkmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijlkmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijlkmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijlkmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijlkmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijlkmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijlkmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijlkmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijlkmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijlkmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijlkmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijlkmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijlkmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijl!
kmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijlkmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijlkmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijlkmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijlkmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijlkmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijlkmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijlkmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijlkmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijlkmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijlkmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijlkmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijlkmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijlkmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijlkmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijlkmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijlkmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijlkmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijlkmnopqrstuvwxyz ABC!
If you were to count all of those chars and lines, like I did you would think a pattern is there, i.e. the rogue char appears at position 985 (if memory serves me correctly)
Now try again with different content and the position will definately move!
If there is nothing wrong with the component, and nothing wrong with my wrapper function then its probably something to do with IIS, hence my question about knowing how to/not enable asp extensions.
netvbonline
12-14-2005, 05:52 PM
HI Shane,
relevant extensions here we go:-
Active server pages
ASP.Net v1.1.4322
ASP.Net v2.0.50727
Server Side Includes
Cheers
TheShaner
12-14-2005, 05:55 PM
It looks as if it's signifying a new line. In your message, you have no spaces and such, and thus no new lines, right? Well, try being realistic and sending a real email and see if you'll get that still. When you write a message and need a new line, I'm guessing you are doing something like:
message = "Hi, thank you for ordering from us!" & vbCrLf & "We are glad you chose us for your ordering needs. Your details are below. " & vbCrLf & vbCrLf & "Order: Widget" & vbCrLf & "Qty: 4" & vbCrLf & "And so on until we pass the 300 character limit to test the ! problem"
Let me know what a real email yields, because, honestly, your emails won't look like that and it may just be a bug between ASP and Outlook 2000 that happens when you just have 300 characters and more in a single string.
-Shane
netvbonline
12-14-2005, 05:56 PM
Crap! I just disabled all ASP extensions apart from the first one and the problem still remains :-)) ahhh
netvbonline
12-14-2005, 06:05 PM
Thanks shane,
thats a good idea and I will try it out to see, however it wont really help me. Let me explain what i'm trying to do :-)
I have basically a number of classes that I use to bring back customer details from a database, the email text is fetched and contains just normal plain text with the vbcrlf markers as required.
I then store the results of the text into a sBody variable and send. This is when the problem first manifested itself in both text and HTML modes. To try and isolate the cause i've stripped away everything down to that code i've posted here.
Even though your example may yield more information it wont fix the problem, I'm new to asp and this damn component and if I cant get this to work then i'm in big trouble what could the major differences be between your code and mine?
netvbonline
12-14-2005, 06:12 PM
good show there shane ..
Hi, thank you for ordering from us
We are glad you chose us for your ordering needs. Your details are below.
Order: Widget
Qty: 4
And so on until we pass the 300 character limit to test the problem
Hi, thank you for ordering from us
We are glad you chose us for your ordering needs. Your details are below.
Order: Widget
Qty: 4
And so on until we pass the 300 character limit to test the problem
Hi, thank you for ordering from us
We are glad you chose us for your ordering needs. Your details are below.
Order: Widget
Qty: 4
And so on until we pass the 300 character limit to test the problem
Hi, thank you for ordering from us
We are glad you chose us for your ordering needs. Your details are below.
Order: Widget
Qty: 4
And so on until we pass the 300 character limit to test the problem
Hi, thank you for ordering from us
We are glad you chose us for your ordering needs. Your details are below.
Order: Widget
Qty: 4
And so on until we pass the 300 character limit to test the problem
Hi, thank you for ordering from us
We are glad you chose us for your ordering needs. Your details are below.
Order: Widget
Qty: 4
And so on until we pass the 300 character limit to test the problem
Hi, thank you for ordering from us
We are glad you chose us for your ordering needs. Your details are below.
Order: Widget
Qty: 4
And so on until we pass the 300 character limit to test the problem
Hi, thank you for ordering from us
We are glad you chose us for your ordering needs. Your details are below.
Order: Widget
Qty: 4
And so on until we pass the 300 character limit to test the problem
Hi, thank you for ordering from us
We are glad you chose us for your ordering needs. Your details are below.
Order: Widget
Qty: 4
And so on until we pass the 300 character limit to test the problem
Hi, thank you for ordering from us
We are glad you chose us for your ordering needs. Your details are below.
Order: Widget
Qty: 4
And so on until we pass the 300 character limit to test the problem
Hi, thank you for ordering from us
We are glad you chose us for your ordering needs. Your details are below.
Order: Widget
Qty: 4
And so on until we pass the 300 character limit to test the problem
Hi, thank you for ordering from us
We are glad you chose us for your ordering needs. Your details are below.
Order: Widget
Qty: 4
And so on until we pass the 300 character limit to test the problem
Hi, thank you for ordering from us
We are glad you chose us for your ordering needs. Your details are below.
Order: Widget
Qty: 4
And so on until we pass the 300 character limit to test the problem
Hi, thank you for ordering from us
We are glad you chose us for your ordering needs. Your details are below.
Order: Widget
Qty: 4
And so on until we pass the 300 character limit to test the problem
Hi, thank you for ordering from us
We are glad you chose us for your ordering needs. Your details are below.
Order: Widget
Qty: 4
And so on until we pass the 300 character limit to test the problem
Hi, thank you for ordering from us
We are glad you chose us for your ordering needs. Your details are below.
Order: Widget
Qty: 4
And so on until we pass the 300 character limit to test the problem
Hi, thank you for ordering from us
We are glad you chose us for your ordering needs. Your details are below.
Order: Widget
Qty: 4
And so on until we pass the 300 character limit to test the problem
Hi, thank you for ordering from us
We are glad you chose us for your ordering needs. Your details are below.
Order: Widget
Qty: 4
And so on until we pass the 300 character limit to test the problem
Hi, thank you for ordering from us
We are glad you chose us for your ordering needs. Your details are below.
Order: Widget
Qty: 4
And so on until we pass the 300 character limit to test the problem
Hi, thank you for ordering from us
We are glad you chose us for your ordering needs. Your details are below.
Order: Widget
Qty: 4
And so on until we pass the 300 character limit to test the problem
Hi, thank you for ordering from us
We are glad you chose us for your ordering needs. Your details are below.
Order: Widget
Qty: 4
And so on until we pass the 300 character limit to test the problem
Hi, thank you for ordering from us
We are glad you chose us for your ordering needs. Your details are below.
Order: Widget
Qty: 4
And so on until we pass the 300 character limit to test the problem
Hi, thank you for ordering from us
We are glad you chose us for your ordering needs. Your details are below.
Order: Widget
Qty: 4
And so on until we pass the 300 character limit to test the problem
Hi, thank you for ordering from us
We are glad you chose us for your ordering needs. Your details are below.
Order: Widget
Qty: 4
And so on until we pass the 300 character limit to test the problem
Hi, thank you for ordering from us
We are glad you chose us for your ordering needs. Your details are below.
Order: Widget
Qty: 4
And so on until we pass the 300 character limit to test the problem
Hi, thank you for ordering from us
We are glad you chose us for your ordering needs. Your details are below.
Order: Widget
Qty: 4
And so on until we pass the 300 character limit to test the problem
Hi, thank you for ordering from us
We are glad you chose us for your ordering needs. Your details are below.
Order: Widget
Qty: 4
And so on until we pass the 300 character limit to test the problem
Hi, thank you for ordering from us
We are glad you chose us for your ordering needs. Your details are below.
Order: Widget
Qty: 4
And so on until we pass the 300 character limit to test the problem
Hi, thank you for ordering from us
We are glad you chose us for your ordering needs. Your details are below.
Order: Widget
Qty: 4
And so on until we pass the 300 character limit to test the problem
As you can see problem does not remain ... but how can I fix this quickly without a hack ?
TheShaner
12-14-2005, 06:12 PM
EDITTED
Hmmm. Well, I just took out the code to my email since it's not a problem with your email. It's a problem with your message set up.
Just saw your next post. Your problem is how your information is being retrieved from the DB and stringed together in a variable. Are you able to show me how you put together this variable for your body. I think the vbCrLf you have set up is bad or something. Not sure. Compare how your message is put together compared to the one you just tested and see if you can figure out any differences.
-Shane
netvbonline
12-14-2005, 06:15 PM
Could it be that ASP is the one changing the message as it parses the contents of sBody into the component ?
Is there some kind of limit to how many chars you can store within ASP variable in this way?
netvbonline
12-14-2005, 06:20 PM
Thanks for code Shane ... at the moment i'm not having to hard code the emails thanks to my classes and the emails need to be easily updated by admin people.
Its rather tempting to hard code the email text in this way but in doing so i'd create new problems :-)
Any chance of you sending our testing single line message to an outlook 2K user in your office ?
Its probably either ASP or the component, I dont think IIS would get in the way?
TheShaner
12-14-2005, 06:20 PM
Didn't you put the message you just pasted into one variable? If so, then you know it's not a limit problem. I really think there may be an extraneous value from the DB or something because that one example worked.
EDIT: Unfortunately, everyone in our office has Office 2003, hehe. So I can't test it here. Wish I could be of more help.
-Shane
netvbonline
12-14-2005, 06:34 PM
Hi Shane,
>Are you able to show me how you put together this variable for your body
Theres quite alot of code there, its probably easier if I try to explain first.
Basically when I fetch the raw text from a long text field, it contains text and the vbcrlf pairs if I write this text to a log file and then attach that file, it works and the strange rogue char doesnt appear.
If I write the text to the browser window, guess what no exclamation character present.
The only time its present is when I open the email in outlook 2K, in yahoo for example its fine.
I populate the variable like this :
strEmailBody = objClass.EmailText
Doe that help ..?
netvbonline
12-14-2005, 06:38 PM
>there may be an extraneous value from the DB or something because that one
>example worked
But wouldnt the exclamation mark also appear in the text file and maybe on the screen ..? Its not on screen and not in the text file, and not in yahoo mail only outlook
This problem is a knightmare to debug !
TheShaner
12-14-2005, 06:41 PM
Only thing I can think of is that since you're grabbing the text from a database that already contains the vbCrLf and other characters, that coming from the database into the ASP code, it's being misinterpretted somehow by Outlook.
EDIT: Just saw your next post. I think that everything else interprets this extraneous value as nothing whereas Outlook interprets it as an exclamation mark. But then again, if it's not in the text file, I don't know.
I'm as stuck as you, lol. Sorry!
-Shane
netvbonline
12-14-2005, 07:05 PM
he he, its ok Shane ... Also I thought about what you said about some weird character in database field and remembered that I have a displayHTML function with takes the text from the same method and then replaces every instance of VbCrLf with <BR><BR> .. and that rendered correctly.
This means the vbcrlf chars are present and valid :-)) ... but remember the example I first gave you was "ABCDE ...." was hardcoded and the problem manifested because there was no "& vbCrLf" chars present hence why your suggestion worked.
I have no idea how and why a rogue char would be present ..? its just stored as:
date
vbcrlf
vbcrlf
Dear Sir
vbcrlf
vbcrlf
Thankyou for your submission ... (text continues)
vbcrlf
I'm going to cry :( :confused: :eek:
TheShaner
12-14-2005, 07:19 PM
I have no idea how and why a rogue char would be present ..? its just stored as:
date
vbcrlf
vbcrlf
Dear Sir
vbcrlf
vbcrlf
Thankyou for your submission ... (text continues)
vbcrlf
I think that's your problem. You're storing the vbCrLf as part of the string. ASP needs to be able to interpret the vbCrLf. If you were to do this:
message = "datevbcrlfvbcrlfDear SirvbcrlfvbcrlfThankyou for your submission ... (text continues)vbcrlf"
It wouldn't work. You'd need:
message = "date" & vbcrlf & vbcrlf & "Dear Sir" & vbcrlf & vbcrlf & "Thankyou for your submission ... (text continues)" & vbcrlf
Because ASP will NOT store the message as datevbcrlf and so on. It stores it with line breaks into the message variable, not the actual word.
-Shane
netvbonline
12-14-2005, 07:58 PM
Hi Shane,
you understand that i'm not actually storing the word vbCrLf rather the control charaters right?
In which case how on earth could you ever take a variable and then format the contents unless special chars were present?
Do you know what the line break character code is because I could do a
text = replace(text,linebreak,vbCrLf)
I need someway to interpret the line breaks / control char(s) and then replace with the vbCrLf equivelents maybe ?
btw, I really appreciate you hanging around to help little old me :-))
BarrMan
12-14-2005, 08:07 PM
Post all the code here please... the updated one... i'll take a look at it.
netvbonline
12-14-2005, 08:29 PM
barrman,
nice one
text = "hi this is a test" & vbCrLf x 300
Above Works
This doesnt:
text = obj.FetchText() ' this fetches raw text including vbCrLf chars from db field.
I get the nasty ! char.
I have outputted the text variable to browser window, log file and email it works in all cases apart from within outlook 2000.
Shane might be right in thinking that for some reason, the control chars stored in variable do not translate in the objCDOMail.Send method when view in outlook ?
Call SendEmail("address","address","test","text")
Public Sub SendEmail(sTo, sFrom, sSubject, sBody)
dim objCDOMail
Set objCDOMail = server.CreateObject("CDO.Message")
objCDOMail.From = sFrom
objCDOMail.To = sTo
objCDOMail.Subject = sSubject
objCDOMail.TextBody = sBody
objCDOMail.Send
Set objCDOMail = Nothing
end sub
Cheers
TheShaner
12-14-2005, 08:35 PM
All I can think of is that the DB is screwing up the line break characters somehow.
Do something like this and see what your message looks like:
linebreak1 = vbCrLf
linebreak2 = vbCrLf & vbCrLf
sBody = Replace(sBody,linebreak1,linebreak2)
This will take all your line breaks and double them. Let me know where the ! shows up.
-Shane
BarrMan
12-14-2005, 09:02 PM
Why not quote it in the replace?
str = Replace(str,"VBCrlf","VBCrlf & VBCrlf")
Does it write it 300x times as vbcrlf & vbcrlf & vbcrlf?
for i = 1 to 300
response.write "vbcrlf &"
next
I'm not really sure whats the problem so i'm just trying to give advises and ways you can try. :S
TheShaner
12-14-2005, 09:26 PM
Because when you quote the vbCrLf character, it's not the new line character anymore and it's now a string.
Also, printing the vbCrLf character is not the problem.
No offense or anything, but please only post if you have at least some working idea of the problem at hand. It's a bit more complicated than printing out new line characters, hehe. You're trying to correct my code that I'm offering to help debug his strange problem. My debugging code is fine, lol.
-Shane
BarrMan
12-14-2005, 09:34 PM
lol, i'm just trying to help... i didn't mean to spam the thread or something... if i have a better idea i'll post it...
netvbonline
12-15-2005, 02:00 PM
Hi Shane,
Thanks for all your help and sticking with me on this but I think i've found the cause!! :) or at least on right path.
It doesnt appear to be the code at all! Rather a problem with the btconnect ISP when using CDO Win2K.
Still waiting for them to confirm, but when I sent the same identical email to numerous other pop accounts and viewed the message in outlook there was no rogue character present, only when I sent it to a btconnect account.
WOW, If only i'd thought of that earlier rather than just expecting the problem to be with my code.
Like I said they havent confirmed yet, any ideas ??? Could it be the content filter at BT or something?
Here is the header:
Received: from hesl04uker.he.local ([10.87.8.97]) by HEMV2BUKER.he.local with Microsoft SMTPSVC(6.0.3790.211);
Thu, 15 Dec 2005 11:56:39 +0000
Received: from C2bthimr10.btconnect.com ([194.73.73.219]) by hesl04uker.he.local with Microsoft SMTPSVC(6.0.3790.211);
Thu, 15 Dec 2005 11:56:39 +0000
Received: from S73929 (newserver.com [81.128.155.192] (may be forged))
by C2bthimr10.btconnect.com (MOS 3.5.9-GR)
with ESMTP id DFR85595;
Thu, 15 Dec 2005 11:56:30 GMT
Received: from mail pickup service by S73929 with Microsoft SMTPSVC;
Thu, 15 Dec 2005 11:14:20 +0000
thread-index: AcYBaLHysFoLruDeTTu3ZUMbBld0MQ==
Thread-Topic: Test mail to ellis earlybird outlook
From: <update@somedomain.com>
To: <ellis@btconnect.com>
Subject: Test mail to ellis earlybird outlook
Date: Thu, 15 Dec 2005 11:14:20 -0000
Message-ID: <000301c60168$b1f248f0$8590e60a@S73929>
MIME-Version: 1.0
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.326
X-OriginalArrivalTime: 15 Dec 2005 11:14:20.0218 (UTC) FILETIME=[B20ED1A0:01C60168]
X-Junkmail-Status: score=10/50, host=C2bthimr10.btconnect.com
X-Junkmail-SD-Raw: score=unknown, refid=str=0001.0A090207.43A159CB.0041,ss=1,fgs=0, ip=81.128.155.192
Return-Path: update@somedomain.com
Ideas?
:thumbsup:
netvbonline
12-15-2005, 02:57 PM
ohh it just gets better lol
Taking into consideration what I said above about CDO, I decided to use a email class that I developed myself a few years back. I couldnt believe me luck, the exact same problem occurred in a completely different component!
AND whats more that component has been used in a commercial environment for the last 3 years sending daily emails to btconnect address mail boxes! With no sign of the rogue character.
So for my own amusement I thought, could it be that i've been incredibly lucky in the past ? So I changed the template to repeat the text 3 times and guess what I now see ! everywhere
WHAT THE HELL !
netvbonline
12-15-2005, 03:20 PM
Just when you think it cant get any better ...
The ISP seems to be counting the number of chars in proporation to overall size of the email. Then based on that calculation, they insert "!" and a carriage return wherever *they believe* is appropriate (LOL) hence screwing up your format and making you waste days tracking down there problem
how annoying,
TheShaner
12-15-2005, 03:23 PM
Wow. Just Wow. I think my supposed "help" is definitely at an end here. That's just confusing as hell and makes my head hurt. I sort of feel your pain, but with an edge of relief that I'm not the one dealing with that problem, lol. Good luck! ... Wow.
-Shane
netvbonline
12-15-2005, 03:56 PM
:D Thanks again
[HOK]Unit
02-22-2006, 03:21 PM
I ran into the same problem trying to send e-mails using a php-script. I'm glad that you figured out that the ISP is doing this, I was slowly going mad. The solution was quite simple after reading this. The ! appeared only where the lines in the e-mail became too long. The ISP script that inputs the !'s counts all lines of code as e-mail body too, so by simply putting a return somewhere in my code (preventing long single lines to form) the problem was solved.
brian8655
06-20-2006, 09:05 PM
I posted this on a board a couple months ago:
The random spaces appear to not be so random after all. They are occuring
every 991 characters. Once I figured this out I was able to find additional
articles on the web. Please look at
http://www.frontpagewebmaster.com/m-212454/tm.htm. It looks like all you have
to do is add Mail.BodyPart.ContentTransferEncoding = "quoted-printable" before
Mail.HTMLBody = mailStr and it should fix it. I tested it and it appears to
resolve the issue. If you are curious about the encoding types, an article
can be found at
http://msdn.microsoft.com/library/d...er-encoding.asp.
If you find any more glitches in this, please let me know. Thanks.
I thought I had it fixed, but I was wrong. This "fix" had no affect on the problem at all. I was using CDO to send out email flyers. The spaces were being inserted in the middle of hrefs, images, and html tags, reaking all sorts of havoc on my pages. I have since duct taped it. Whenever I start a new tag I am starting a new line. The problem only surfaces if there are at least 990 characters on one line without a break. If anyone has a more permanent solution I would love to hear it. Thanks.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.