Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I have a program that sends out email with a long url that has over 76 characters, it seems that if someone checks their e-mail on yahoo per example the url gets broken on the 76th character.
print $sock "http://www.testing.com/cgi-bin/appoint/cxz.pl?num=$number +&line=$line&company_name=$AoH{38}\r\n"; http://www.testing.com/cgi-bin/appoint/cxz.pl?num=1DS58K3&line=01&comp +any_name=Advanced%20Serv.Comp.

Does anyone ever had this problem before or there is any way I could fix this issue, thanks for the help in advance.

Replies are listed 'Best First'.
Re: E-mail 76th Character Issue
by EdwardG (Vicar) on May 19, 2004 at 14:32 UTC

    Three options spring to mind, none of them guaranteed, and all of them possibly annoying in different contexts:

    1. Turn off text wrapping where possible

    2. Enclose the URL in angle brackets, like this - <http://example.org> - it seems to pacify some email applications

    3. Send your email as HTML

     

      May be write an application that will send a reference to a file where the actually url lives.

        If I understand you correctly, and I'm far from sure that I do, I think you are suggesting that you could send a shorter reference to a location that then would either forward the request to the longer url, or simply display it for the user to click upon.

        If this is the gist of your suggestion, frankly, it sounds like quite a lot of extra complexity for such a small problem.

        Perhaps you should ask your users how they would like to deal with this problem, since chances are reasonable that they have encountered it before, as most web users - especially users of web based email - have encountered text-wrapped urls at some time or another.

        If someone asked me whether I would prefer to manually fix these text-wrapped urls or deal with an intermediate reference, like the one you seem to be suggesting, I would choose the former.

         

Re: E-mail 76th Character Issue
by theon (Beadle) on May 19, 2004 at 14:55 UTC
    The official formatting is <URL:http://your.url.com> and should be recognized by any decent mail reader (even with nth character limit, even webmails, etc.) Did you try it ?

    I see "tinyurl" propositions. I think you should avoid it :
    • it obfuscates the target
    • it's a bit slower
    • you add a "single point of failure" (particularly for archived mails)
      Yes it seems that yahoo has a rule that breaks the lines after 76th character.
Re: E-mail 76th Character Issue
by Abigail-II (Bishop) on May 19, 2004 at 14:56 UTC
    Use a smaller font. ;-)

    Abigail

Re: E-mail 76th Character Issue
by hsinclai (Deacon) on May 19, 2004 at 14:01 UTC
    http://tinyurl.com/

    solves that problem, has nothing to do with Perl (sorry:)

Re: E-mail 76th Character Issue
by Anonymous Monk on May 19, 2004 at 14:09 UTC
    Not really a fix in perl but you could use http://tinyurl.com/

    "Are you sick of posting URLs in emails only to have it break when sent causing the recipient to have to cut and paste it back together? Then you've come to the right place. By entering in a URL in the text field below, we will create a tiny URL that will not break in email postings and never expires."