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

Hi.

I'm having a big problem when sending html email containing a link to a flash file. $ecard contains the value: http://www.forrealty.net/ecards/farm_1_one.swf . Here's the html code that goes in the email:

$msg = qq(<html><body><center><table border="0" cellspacing="1" cellpa +dding="0"> <tr><td><center><img src="$photo"><br><font size="2"> <b>$FORM{'agtname'}<br> $FORM{'company'}<br> Phone:</b> $FORM{'pnum'} <p>Click here to visit my web site:<br> <a href="$FORM{'website'}" target="_blank">$FORM{'website'}</a></font> +</center></td> <td><td><td><center> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/sw +flash.cab#3,0,0,0" width="424" height="402"><param name="SRC" value="$ecard"> <embed src="$ecard" pluginspage="http://www.macromedia.com/shockwave/download/" type="ap +plication/x-shockwave-flash" width="424" height="402"> </embed></object> </center></td></tr></table><br> <font size="2"><b>AOL Users:</b> <a href="$ecard" target="_blank"> Click here if you can't see the ecard above. </a></font></center> <p>$body</body></html>);


What happens is that when it outputs the email, the link saying "Click here if you..." gets corrupted. It adds an exclamation mark (!) to the link and messes up the whole url. This only happens though, if the 'Click here...' link is the same as the link of the flash file that gets displayed in the email. For some really weird reason, it can't have the same link twice in the email!

Does anybody know how to fix this problem?

Thanks,
Ralph :)

2001-09-17 Edit by Corion: Added CODE tags and reformatted the HTML (it was on one line previously)

Replies are listed 'Best First'.
Re: Bug when sending email
by suaveant (Parson) on Sep 17, 2001 at 19:24 UTC
    Hmmm, it almost sounds like you have form data that uses the same field name, and is getting joined by \0 or something like that... (just a guess)... are all the names in your html form unique, or do you reuse field names somewhere?

                    - Ant
                    - Some of my best work - Fish Dinner

Re: Bug when sending email
by Anonymous Monk on Sep 18, 2001 at 00:08 UTC
    Every form field is unique.

    What happens is that when I try to display the same url twice on the email, the second time it's displayed it gets corrupted (with that exclamation mark). It's like if sendmail or perl has a bug when pumping out the email.

    I'll appreciate any help.

    Thanks,
    Ralph.
Re: Bug when sending email
by Anonymous Monk on Sep 18, 2001 at 13:33 UTC
    Oops! I found where the error was. I had a silly typo in the html code (in the table tags), so it messed up the whole thing.

    Well, thanks for your help anyway!

    Ralph :)