Connecting Tech Pros Worldwide Forums | Help | Site Map

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

Dave Smithz
Guest
 
Posts: n/a
#1: Jul 21 '05
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



Philip Ronan
Guest
 
Posts: n/a
#2: Jul 21 '05

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


"Dave Smithz" wrote:
[color=blue]
> 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?[/color]

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/


Dave Smithz
Guest
 
Posts: n/a
#3: Jul 21 '05

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


Thanks for your suggestions. Please see my comments inline.

"Philip Ronan" <invalid@invalid.invalid> wrote in message[color=blue]
> 1. Visit http://tinyurl.com/[/color]

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?
[color=blue]
> -- 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>[/color]

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?

[color=blue]
> -- OR --
>
> 3. Make your URLs shorter so they don't break. This is obviously the best
> solution.[/color]

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


Philip Ronan
Guest
 
Posts: n/a
#4: Jul 21 '05

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


"Dave Smithz" wrote:
[color=blue]
> Thanks for your suggestions. Please see my comments inline.
>
> "Philip Ronan" <invalid@invalid.invalid> wrote in message[color=green]
>> 1. Visit http://tinyurl.com/[/color]
>
> 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?[/color]

Perhaps not, unless tinyurl.com don't mind getting automated requests.
[color=blue][color=green]
>> 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>[/color]
>
> 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?[/color]

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.
[color=blue][color=green]
>> 3. Make your URLs shorter so they don't break. This is obviously the best
>> solution.[/color]
>
> 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.[/color]

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/


Dave Smithz
Guest
 
Posts: n/a
#5: Jul 21 '05

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


Thanks again for reply. Replies inline.

"Philip Ronan" <invalid@invalid.invalid> wrote in message[color=blue][color=green][color=darkred]
>>>
>>> <http://www.example.com/path/to/a-scr...name?and=a&lon
>>> g=search&string=stuck&on=at&the=end>[/color][/color]
>
> 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.[/color]
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>

[color=blue]
> 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[/color]

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


Philip Ronan
Guest
 
Posts: n/a
#6: Jul 21 '05

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


"Dave Smithz" wrote:
[color=blue]
> 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>[/color]

Oops. that didn't work for me either -- the link ended at "...Mailer)". :-(
[color=blue][color=green]
>> http://www.example.com/jump.php?to=1
>> http://www.example.com/jump.php?to=2
>> http://www.example.com/jump.php?to=3[/color]
>
> 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.[/color]

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.
[color=blue]
> 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.[/color]

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 ;-)
[color=blue]
> 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.[/color]

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

--
phil [dot] ronan @ virgin [dot] net
http://vzone.virgin.net/phil.ronan/


Dave Smithz
Guest
 
Posts: n/a
#7: Jul 21 '05

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



"Philip Ronan" <invalid@invalid.invalid> wrote in message[color=blue][color=green]
>> 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>[/color]
>
> Oops. that didn't work for me either -- the link ended at "...Mailer)".
> :-([/color]
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.

[color=blue]
> 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 ;-)
>[color=green]
>> 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.[/color]
>
> A text part with a text box? You lost me there...[/color]

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.


John Dunlop
Guest
 
Posts: n/a
#8: Jul 21 '05

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


Dave Smithz wrote:
[color=blue]
> So am I right in thinking tinyURL would not help?[/color]

It's arguable whether TinyURL ever helps.

--
Jock
Raj Shekhar
Guest
 
Posts: n/a
#9: Jul 27 '05

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


"Dave Smithz" <SPAM FREE WORLD> writes:

[color=blue]
> 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?[/color]


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
Closed Thread