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

coding Plian text email urls

I'm sure this is an easy one, but I am a relative newcomer to asp.

I am sending an email to subscibers of a news letter with the url of the
latest newsletter in the email. this is built up in code. how do i encode it
to include special characters such as spaces as %20. I have tried a simple
replace routine but this gives errors on invalid chars.

thanks
Jul 19 '05 #1
3 1249
> latest newsletter in the email. this is built up in code. how do i encode
it
to include special characters such as spaces as %20.
Why does your URL have to have spaces???
I have tried a simple
replace routine but this gives errors on invalid chars.


What "simple replace routine"? What "errors"? What "invalid chars"? Could
you be more specific? What is the code that you tried? What is the string
you passed into the function? What was the result?

Have you considered using Server.URLEncode?

--
http://www.aspfaq.com/
(Reverse address to reply.)
Jul 19 '05 #2
You need the HTMLEncode(strStringToEncode) of the ASP Server object.

Refer this link from the Platform SDK for details [Server.HTMLEncode]:

http://msdn.microsoft.com/library/de...seromhtenc.asp

Cheerz,
Denzil

"KevinC" <Kclayton_rem@ve_ntlworld.com> wrote in message news:<tx************@newsfe2-gui.ntli.net>...
I'm sure this is an easy one, but I am a relative newcomer to asp.

I am sending an email to subscibers of a news letter with the url of the
latest newsletter in the email. this is built up in code. how do i encode it
to include special characters such as spaces as %20. I have tried a simple
replace routine but this gives errors on invalid chars.

thanks

Jul 19 '05 #3
Further to my earlier post, also have a look at Server.URLEncode -
that should serve your needs better for encoding URLs - link given
below.

http://msdn.microsoft.com/library/de..._seromuenc.asp

Cheerz,
Denzil

"KevinC" <Kclayton_rem@ve_ntlworld.com> wrote in message news:<tx************@newsfe2-gui.ntli.net>...
I'm sure this is an easy one, but I am a relative newcomer to asp.

I am sending an email to subscibers of a news letter with the url of the
latest newsletter in the email. this is built up in code. how do i encode it
to include special characters such as spaces as %20. I have tried a simple
replace routine but this gives errors on invalid chars.

thanks

Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Dave Smithz | last post by:
Hi, Thanks to this group I discovered the excellent PHP Mailer (http://phpmailer.sourceforge.net/) which I use to send emails. Part of my application emails out hundreds of club members unique...
1
by: Ambuj | last post by:
Can anyone please let me know that how can I handle very long URLs in a text email? I'm writting a bulk email program in VB.Net which sends text emails. The problem is when I've a very long URL it...
12
by: MARTIN LANNY | last post by:
Hi All, In my program I am loading the content of a text file (main.txt) into a string called 'message'. What I need is to convert all urls and emails in this string into html. This is what...
7
by: kapdan01 | last post by:
Greetings, I am presently trying to display chinese characters on a webpage (HTML). I have tried changing the charset to big5, UTF-8 to no avail. Word documents display correctly, as does...
1
by: Charles | last post by:
Hi all, I need C# code for Implementing MD5 Algorithm.. Hope all would have heard of MD5 Algorith... Does any one have the C# coding for that Algorithm.. please Send... ITs URgent..... Thanks...
12
by: amer.terzic | last post by:
Here's what my code is supposed to do (it seems to work fine) Take a char* array and remove a first character from it....as simple as that. The mentioned char* array is a 'global' var shared...
19
by: auratius | last post by:
http://www.auratius.co.za/CSharpCodingStandards.html Complete CSharp Coding Standards 1. Naming Conventions and Styles 2. Coding Practices 3. Project Settings and Project Structure 4....
9
by: Salve =?iso-8859-1?Q?H=E5kedal?= | last post by:
What is the best regular expression for finding urls in plain text files? (By urls I mean http://www.something.com, but also www.something.com, or salve@somewhere.com) Salve
8
by: Bruno Rafael Moreira de Barros | last post by:
I have this framework I'm building in PHP, and it has Search Engine Friendly URLs, with site.com/controller/page/args... And on my View files, I have <?=$this->baseURL;?to print the base URL on the...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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.