link text in sendMail

Discussion in 'Perl Misc' started by Jaks, Jan 12, 2007.

  1. Jaks

    Jaks Guest

    I have the following code in a sub sendMail

    $link1 =
    "mailto:?subject=Account&body=Please%20set%20my%20address%20to%20$address1";

    $link2 =
    "mailto:?subject=Account&body=Please%20set%20my%20address%20to%20$address2";

    print MAIL "
    I would like $link1 to be my primary address

    I would like $link2to be my primary address";

    close (MAIL);

    In the generated email the following text is displayed

    I would like
    mailto:?subject=Account&body=Please%20set%20my%20address%20to%20Banbridge
    to be my primary address.

    How do I get the link text to be displayed as the address ie

    I would like Banbridge to be my primary address.


    Any help would be much appreciated.

    JP
     
    Jaks, Jan 12, 2007
    #1
    1. Advertisements

  2. Jaks

    tfe Guest

    Jaks ha escrito:
    Hello,

    You should extract the email adress from the variables $link1 and
    $link2 and then lines like:
    <a href="$link1">$real_email_adress</a>

    An idea of code is:
    print MAIL "I would like <a href=\"$link1\">".
    ($link1 =~ /mailto:(.+?)\@/)[0].
    .."</a> to be my primary address. ";
     
    tfe, Jan 12, 2007
    #2
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.