Link to home
Start Free TrialLog in
Avatar of jmingo
jmingo

asked on

SENDMAIL: Adding a "! " to my email ?!????!?

I'm sending an email using sendmail, and it mysteriously and randomly seems to place an exclamation mark and then a space or two ("! ") in the link URL, link, or doesn't end the a href tag where it should (will end at the end of the message sometimes). Here is the code i am using, any ideas what could be causing this??

Thanks

__________________________________________________

$r=time . '.' . $$  ;

my @mailnames=split(/ *, */,$email) ;
foreach(@mailnames) {

$link = CGI::escapeHTML($link);

#INSERT INTO DATABASE

$link = CGI::unescapeHTML($link);

$emaillink = "http://www.server.com/test.html?id=$r";
$emaillinklow = "http://www.server.com/test.html?id=$r&highspeed=no";

my $message;

$message = "<html><head><title>test</title></head><style type=\"text/css\">body, td, input, select, textarea { font-size: 13px; font-family: Trebuchet MS,  Verdana, Arial, Sans-Serif; }</style><body bgcolor=#FFFFFF marginwidth=0 marginheight=0 leftmargin=0 topmargin=0><table border=0 cellpadding=0 width=600 cellspacing=0><tr><td valign=top align=left><img src=\"http://www.server.com/images/$background.jpg\"></td></tr><tr><td valign=top align=left><table border=0 cellpadding=3 cellspacing=3><tr><td align=left valign=top>$newemailcontent<br><br><a href=\"$emaillink\"><b>$link</b></a><br><a href=\"$emaillinklow\"><b>$link - For Dial-up</b></a><br><br>$newsignature</body></html>";

open(SENDMAIL, "|$sendmail -t") || die "Unable to open sendmail";

print SENDMAIL "to: $_\n";
print SENDMAIL "from: $fromname <$fromemail>\n";
print SENDMAIL "Reply-to: $fromname <$fromemail>\n";
print SENDMAIL "Return-Path: $fromemail\n";
print SENDMAIL "MIME-Version: 1.0\n";
print SENDMAIL "subject: $subject\n";
print SENDMAIL "Content-Type: text/html; charset=us-ascii\n\n";

print SENDMAIL $message;

print SENDMAIL "\n\n";

close(SENDMAIL);

}
Avatar of Perl_Diver
Perl_Diver

looks like the same question you posted before. Close your other threads if that's the case, if not what is new abiut the problem? Nobody really answered before because this does not appear to have anything to do with perl. There is no reason I can think of why perl would insert random-ish characters.
You might also attract more attention if the answer were worth 500 points.
Avatar of jmingo

ASKER

could peoples email clients/systems possibly be doing something to it do you suppose?
ASKER CERTIFIED SOLUTION
Avatar of clockwatcher
clockwatcher

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jmingo

ASKER

clockwatcher: i think that might be it.... thanks a lot!! i will fix that.