jmingo
asked on
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.
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.
ASKER
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-mail l</title>< /head><sty le 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>$newemailconten t<br><br>< a href=\"$emaillink\"><b>$li nk</b></a> <br><a href=\"$emaillinklow\"><b> $link - For Dial-up</b></a><br><br>$ne wsignature </body></h tml>";
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);
$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-mail
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);
ASKER
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.
ASKER
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??
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??
Are you reffering to Novell GroupWise? If so maybe that's where you should be asking this question:
https://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.
https://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.
ASKER
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 = "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!!
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!!
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;
my $r = time . '.' . $$;
my $emaillinklow = "http://server.com/email.html?id=$r&highspeed=no";
print $emaillinklow;
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?
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?
ASKER
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.
ASKER
solution provided above
thanks
thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Could you post the relevant code?