473,394 Members | 1,701 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,394 software developers and data experts.

Bizarre formatting issues building text email with VBScript

I'm working with VBScript to build a text email message. I'm seeing a variety of bizarre formatting issues. The following lines of code

MT = MT & vbCrLf & "Card Type: " & CardType
MT = MT & vbCrLf & "Credit Card Number: " & objBOWallet.Encrypt(Payment.[_account_number])
If Not IsNull(Payment.[_expiration_month]) Then
MT = MT & vbCrLf & "Expiration Month: " & Payment.[_expiration_month]
End If
If Not IsNull(Payment.[_expiration_year]) Then
MT = MT & vbCrLf & "Expiration Year: " & Payment.[_expiration_year]
End If
MT = MT & vbCrLf & "Payment Amount: " & Context.DataFunctions.Money(Payment.payment_amount )

results in the following text in the email:

Card Type: Visa
Credit Card Number: ?Hn<j;?AKPBROcTYPSiUjk Expiration Month: 7 Expiration Year: 2008 Payment Amount: $25.34

with Space characters where there should be CRLF characters. Changing the second line from
MT = MT & vbCrLf & "Credit Card Number: " & objBOWallet.Encrypt(Payment.[_account_number])
to
MT = MT & vbCrLf & "Credit Card Number: " & Tab(1) & objBOWallet.Encrypt(Payment.[_account_number])
(adding the Tab(1)) "fixes" the problem, but I can't see why. Why would a Tab character in one line impact the CRLF characters in three subsequent lines?

The most recent behavior is, to me, even more bizarre as I am now getting CRLF characters appearing in the middle of what are string literals in the code. For example, the following code

If Not IsNull(OrderForm.advcode) Then
MT = MT & vbCrLf & "Affilate or Advertising code:" & Tab(1) & Trim(OrderForm.advcode)
End If
If Not IsNull(OrderForm.Special_Offer) Then
MT = MT & vbCrLf & "Special Offer Code:" & Tab(1) & Trim(OrderForm.Special_Offer)
End If
MT = MT & vbCrLf & "Order Number:" & Tab(1) & OrderForm.OrderNumber

results in the following text in the email:

Affilate or Advertising code:Special
Offer Code:Order
Number: 10100625021

Instead of getting CRLF characters before the "Special Offer Code:" and "Order Number:" strings, there are CRLF characters inserted into the middle of each string. I can't make head nor tails of what's going on. Has anyone seen anything like this???
Oct 10 '06 #1
1 2675
Never mind. I had my VBScript right the text out to a file and found that it was correctly formatted. Somewhere in the mail processing (mail server, mail client, SMTP stack) it's getting messed up. Not sure there's much I can do about that.
Oct 10 '06 #2

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

Similar topics

3
by: joe ruggeri | last post by:
Hey All ... I'm developing in ASP/VBScript using DreamweaberMX, w/ an Access 2000 DB as the data source. The source of the data is coming from a third party, which I get as a CSV and import into...
8
by: the other john | last post by:
I have a client that wants a time field to resolve to 7:00 PM rather than 7:00:00 PM (wants the seconds gone). vbLongTime provides the later but vbShortTime produces a 24 hour version or 19:00. ...
4
by: Wayne Aprato | last post by:
I have a simple database which was originally written in Access 97. When converted to Access 2000 file format it ran flawlessly in Access 2002. I've just tried to run it in Access 2003 and I am...
12
by: dmieluk | last post by:
Problem: When moving between records, I need to control which combo/text boxes are displayed on the current form, dependent upon data in the current record. More: I building my first...
3
by: WU10 | last post by:
I have built a simple database to track the mechanical condition of offshore equipment. We established a system of ranking for issues that arise and used conditional formatting of the cell's...
3
by: Don Miller | last post by:
I have a bizarre problem when I try to validate XML documents and their schemas once they have been opened and transfered to a Visual Web Developer 2005 Express project. I receive validation errors...
10
by: sara | last post by:
Hi - I have a report that is 14 columnar sub-reports (Line up: Position- holders in each of our 14 locations - Manager, Assistant Manager, Receiving, Office, etc). I output directly to PDF...
1
by: dbuchanan | last post by:
I want to fill a textbox or a label or with lines from a listbox. I want to preserve the lline for line as it comes from the list box. I do not want the test to run-on. I suppose it is okay to wrap...
6
by: =?Utf-8?B?UVNJRGV2ZWxvcGVy?= | last post by:
I am using a RichTextControl (C# VS2005 .NET 2.0) and allowing users to change the font and color of what ever they select. The problem I am having is that when I select a second set of character...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: 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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
0
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
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
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...

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.