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

http://server.com/email.html?i d=1148406418.46167
and
http://server.com/email! .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.
jmingoAsked:
Who is Participating?
 
GhostModCommented:
Closed, 25 points refunded.

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

Could you post the relevant code?

0
 
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 = "http://server.com/email.html?id=$r";
$emaillinklow = "http://server.com/email.html?id=$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=\"http://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);
0
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.
0
 
Perl_DiverCommented:
print $message to the screen and see what it looks like before sending in the email.
0
 
jmingoAuthor Commented:
perl_diver: i'll try that.

if i email two people (for ex. me@here.com, them@groupwise.com)

me@here.com 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??
0
 
Perl_DiverCommented:
Are you reffering to Novell GroupWise? If so maybe that's where you should be asking this question:

http://www.experts-exchange.com/Applications/Groupwise/

If not, I don't undserstand what groupwise.com 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.
0
 
jmingoAuthor Commented:
yes its novell group wise.. thanks, i'll ask the question there.
0
 
nitinsawhneyCommented:
Try using URI::Escape

use URI::Escape;

$safe_r = uri_escape($r);

$emaillink = "http://server.com/email.html?id=$safe_r";
$emaillinklow = "http://server.com/email.html?id=$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.

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

my $r = time . '.' . $$;
my $emaillinklow = "http://server.com/email.html?id=$r&highspeed=no";
print $emaillinklow;
0
 
DireOrbAntCommented:
jmingo,

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?
0
 
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.
0
 
jmingoAuthor Commented:
solution provided above

thanks
0
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.