Perl breaking up URLs ???

I'm sending emails (i've tried MIME and SENDMAIL) both do the same on certain email clients...

I send an email with a link, and here below are some examples of the url breaking d=1148406418.46167
and! .html?id=1146681613.77319

weird how it stuck an ! in one, and put a space in both!?!?!

Any ideas, what could be causing this, the code looks fine. One person was on Groupwise, the other I'm not sure.
Who is Participating?
Closed, 25 points refunded.

Community Support Moderator
How are you getting the link text?  reading from a text file? DB? hard coded?

Could you post the relevant code?

jmingoAuthor Commented:
thanks for the response. here is some of the code sending the email with link.

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

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

$emaillink = "$r";
$emaillinklow = "$r&highspeed=no";

$message = "<html><head><title>e-maill</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=\"$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";
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

jmingoAuthor Commented:
Both users are using groupwise i have found out.
print $message to the screen and see what it looks like before sending in the email.
jmingoAuthor Commented:
perl_diver: i'll try that.

if i email two people (for ex., who uses outlook (no groupwise) will get it fine but the groupwise user will have the url broken up it seems.

so i'm quite sure its a groupwise thing.

any ideas??
Are you reffering to Novell GroupWise? If so maybe that's where you should be asking this question:

If not, I don't undserstand what is besides a website which points to Novell's GroupWise Product information website. I can't see how perl has anything to do with this problem but maybe somenone else will.
jmingoAuthor Commented:
yes its novell group wise.. thanks, i'll ask the question there.
Try using URI::Escape

use URI::Escape;

$safe_r = uri_escape($r);

$emaillink = "$safe_r";
$emaillinklow = "$safe_r" . '&highspeed=no';

Did you notice that second scalar $emaillinklow has been split into two parts. This is done as & is reserved operatior in perl and is used to call subroutines.

Hope this helps.

the & symbol has no special meaning in a double-quoted string, a little test shows that:

my $r = time . '.' . $$;
my $emaillinklow = "$r&highspeed=no";
print $emaillinklow;

Do you know if they are seeing an HTML formatted email or if they see the HTML code in their emails?
Also, you use $link in the $message scalar, what's the content of $link?
jmingoAuthor Commented:
i think the solution was to put some \r\n's in the code. what was happening i think is the code was just all strung together without any line feeds, so some servers were putting in line feeds and ! when it hits like 998 characters or something like that.
jmingoAuthor Commented:
solution provided above

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.