469,364 Members | 2,332 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,364 developers. It's quick & easy.

Email URL to plaintext receivers - URL being truncated (Using PHP Mailer)

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 URL links
which allow them to register for various things.
Sometimes these URLS are long because they contain custom codes.

Problem I am having is that some members are saying the links do not work
and investigating this it is because they are clicking on links that are
being truncated by their email program.

I therefore assume they are viewing email in plain text.

What can I do to get around this?

I send out my emails as plain text anyway, and for me personally and the
majority of members no problems are reported.
I did not want to use HTML mail quite yet as I would first have to make my
application add the HTML tags and also some people will not have HTML
viewers.

Hope this is clear and any help appreciated.

Kind regards

Dave

Jul 21 '05 #1
8 4802
"Dave Smithz" wrote:
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 URL links
which allow them to register for various things.
Sometimes these URLS are long because they contain custom codes.

Problem I am having is that some members are saying the links do not work
and investigating this it is because they are clicking on links that are
being truncated by their email program.

I therefore assume they are viewing email in plain text.

What can I do to get around this?


1. Visit http://tinyurl.com/

-- OR --

2. Put angle brackets around the URLs like this:

<http://www.example.com/path/to/a-scr...name?and=a&lon
g=search&string=stuck&on=at&the=end>

-- OR --

3. Make your URLs shorter so they don't break. This is obviously the best
solution.

--
phil [dot] ronan @ virgin [dot] net
http://vzone.virgin.net/phil.ronan/
Jul 21 '05 #2
Thanks for your suggestions. Please see my comments inline.

"Philip Ronan" <in*****@invalid.invalid> wrote in message
1. Visit http://tinyurl.com/
This would not be practicle. In a single email out I sometimes can have
thousands of different URLs because each member receives their own custom
link. So am I right in thinking tinyURL would not help?
-- OR --

2. Put angle brackets around the URLs like this:

<http://www.example.com/path/to/a-scr...name?and=a&lon
g=search&string=stuck&on=at&the=end>
Does this actually work?? Even the example you gave does not actually work
because the URL got broken? Sounds good, but as it did not work in my
Outlook Express news reader will it work elsewhere?

-- OR --

3. Make your URLs shorter so they don't break. This is obviously the best
solution.


Difficult because I have a unique code for each user which also has to
convey a lot of data. Plus the original URL is also quite long to start
with.

Any more suggestions welcome.

Kind regards

Dave
Jul 21 '05 #3
"Dave Smithz" wrote:
Thanks for your suggestions. Please see my comments inline.

"Philip Ronan" <in*****@invalid.invalid> wrote in message
1. Visit http://tinyurl.com/


This would not be practicle. In a single email out I sometimes can have
thousands of different URLs because each member receives their own custom
link. So am I right in thinking tinyURL would not help?


Perhaps not, unless tinyurl.com don't mind getting automated requests.
2. Put angle brackets around the URLs like this:

<http://www.example.com/path/to/a-scr...name?and=a&lon
g=search&string=stuck&on=at&the=end>


Does this actually work?? Even the example you gave does not actually work
because the URL got broken? Sounds good, but as it did not work in my
Outlook Express news reader will it work elsewhere?


Really? It works in my version of OE (the URL is still on two lines, but
functions as a single link). This format is recommended in RFC 2396, so it
should work in any decent mail reader.
3. Make your URLs shorter so they don't break. This is obviously the best
solution.


Difficult because I have a unique code for each user which also has to
convey a lot of data. Plus the original URL is also quite long to start
with.


Create a table (ideally in a mySQL database) containing your long URLs, and
generate new (shorter) URLs based on the keys to this table.

For example, your table might look like this:

Key Value
1 http://www.example.com/promotions/in...oo&product=123
2 http://www.example.com/feedback/inde...ar&product=456
3 http://www.example.com/licensing/ind...az&product=789

Then all you have to do is make a script to redirect visitors to these URLs
based on the key value, e.g.:

http://www.example.com/jump.php?to=1
http://www.example.com/jump.php?to=2
http://www.example.com/jump.php?to=3

Not that difficult really...

--
phil [dot] ronan @ virgin [dot] net
http://vzone.virgin.net/phil.ronan/
Jul 21 '05 #4
Thanks again for reply. Replies inline.

"Philip Ronan" <in*****@invalid.invalid> wrote in message

<http://www.example.com/path/to/a-scr...name?and=a&lon
g=search&string=stuck&on=at&the=end>

Really? It works in my version of OE (the URL is still on two lines, but
functions as a single link). This format is recommended in RFC 2396, so it
should work in any decent mail reader.

Darn shame this does not work. I assume it is not working because when I
click it, it takes me to a page where the url is only the part on the first
line. This would be a dead easy solution but the fact that it does not work
in OE for me would surely mean that there would be problems.

I'm going to try it again with a real link now (link to this posting)

<http://groups.google.co.uk/group/comp.lang.php/browse_thread/thread/1cb1b4c32adc20ac/6734c79bc12f98e8?q=Re:+Email+URL+to+plaintext+rece ivers+-+URL+being+truncated(UsingPHP+Mailer)&rnum=1&hl=en #6734c79bc12f98e8>

Create a table (ideally in a mySQL database) containing your long URLs,
and
generate new (shorter) URLs based on the keys to this table.

For example, your table might look like this:

Key Value
1 http://www.example.com/promotions/in...oo&product=123
2 http://www.example.com/feedback/inde...ar&product=456
3 http://www.example.com/licensing/ind...az&product=789

Then all you have to do is make a script to redirect visitors to these
URLs
based on the key value, e.g.:

http://www.example.com/jump.php?to=1
http://www.example.com/jump.php?to=2
http://www.example.com/jump.php?to=3


Sounds like a good idea but two problems. The link is like a confirmation
link and there needs to be no chance of you guessing someone else's link.
Secondly I had not budgeted for building this. As in I've already done a lot
of overtime for client and as they send out thousands of URL links so I
would have to think about implementing a new table etc.

Looks like I'll have to create a HTML email and then a text part to that
email that has a text box where the user just types in their code into a
form text box. Unless any other good ideas.

Regards
Jul 21 '05 #5
"Dave Smithz" wrote:
I'm going to try it again with a real link now (link to this posting)

<http://groups.google.co.uk/group/com...read/1cb1b4c32
adc20ac/6734c79bc12f98e8?q=Re:+Email+URL+to+plaintext+rece ivers+-+URL+being+tr
uncated(UsingPHP+Mailer)&rnum=1&hl=en#6734c79bc12f 98e8>
Oops. that didn't work for me either -- the link ended at "...Mailer)". :-(
http://www.example.com/jump.php?to=1
http://www.example.com/jump.php?to=2
http://www.example.com/jump.php?to=3


Sounds like a good idea but two problems. The link is like a confirmation
link and there needs to be no chance of you guessing someone else's link.


The keys don't have to be consecutive numbers, just unique values. For
example, you could prefix each key with a random 8-digit number. That way
the success rate of random attacks would only be 1 in 100 million.
Secondly I had not budgeted for building this. As in I've already done a lot
of overtime for client and as they send out thousands of URL links so I
would have to think about implementing a new table etc.
Well like I said it isn't a massive amount of work. But as long as your
links are RFC 2396 compliant then you can at least defend your work when the
client complains ;-)
Looks like I'll have to create a HTML email and then a text part to that
email that has a text box where the user just types in their code into a
form text box. Unless any other good ideas.


A text part with a text box? You lost me there...

--
phil [dot] ronan @ virgin [dot] net
http://vzone.virgin.net/phil.ronan/
Jul 21 '05 #6

"Philip Ronan" <in*****@invalid.invalid> wrote in message
I'm going to try it again with a real link now (link to this posting)

<http://groups.google.co.uk/group/com...read/1cb1b4c32
adc20ac/6734c79bc12f98e8?q=Re:+Email+URL+to+plaintext+rece ivers+-+URL+being+tr
uncated(UsingPHP+Mailer)&rnum=1&hl=en#6734c79bc12f 98e8>
Oops. that didn't work for me either -- the link ended at "...Mailer)".
:-(

That is sad, because that time it did work for me. It's a funny one that.
Might as well add the angle brackets anyway.

Well like I said it isn't a massive amount of work. But as long as your
links are RFC 2396 compliant then you can at least defend your work when
the
client complains ;-)
Looks like I'll have to create a HTML email and then a text part to that
email that has a text box where the user just types in their code into a
form text box. Unless any other good ideas.


A text part with a text box? You lost me there...


Did not explain very well. In summary I will make the page for an invalid
code be a form with a text box. In that text box the user can enter their
unique code that is the end part of the URL so in my emails I might send out

goto this URL

www.example.com/longparameters

if you have problems enter this code
longparameters.

or something similar. OK still a lazy explanation I know but hopefully makes
sense.

Thanks again.
Jul 21 '05 #7
Dave Smithz wrote:
So am I right in thinking tinyURL would not help?


It's arguable whether TinyURL ever helps.

--
Jock
Jul 21 '05 #8
"Dave Smithz" <SPAM FREE WORLD> writes:

Part of my application emails out hundreds of club members unique URL links
which allow them to register for various things.
Sometimes these URLS are long because they contain custom codes.

Problem I am having is that some members are saying the links do not work
and investigating this it is because they are clicking on links that are
being truncated by their email program.

I therefore assume they are viewing email in plain text.

What can I do to get around this?

You can use a url shortener to build a smaller url and pass on that url
in your email.

Regards
(someone who hopes he is not helping a spammer)
--
Raj Shekhar
blog : http://rajshekhar.net/blog home : http://rajshekhar.net
Disclaimer : http://rajshekhar.net/disclaimer
Jul 27 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Dave Smithz | last post: by
3 posts views Thread by John | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.