Easy question

Hello, I want to print the following sentence using the print command.
Http://www.postbank.nl?test&test2
I already tried:
print "http://www.postbank.nl?test&test2" but that didn't work.
Help me out please.
quickbasicAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

guadalupeCommented:
Could it be that you forgot the ";"

print "http://www.postbank.nl?test&test2";
0
maneshrCommented:
are you sure?? what does it print? or does it give you an error message?

did you put a ; at the end of the print statement??

i tried the foll and it works!!

#!/usr/local/bin/perl

print "http://www.postbank.nl?test&test2";
0
guadalupeCommented:
You understand that when this gets to the screeen/browser it will be not be a link and it will not redirect the browser to this link?
0
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

quickbasicAuthor Commented:
Well, actually i wan't to write an e-mail script that sends me an e-mail which includes the mentioned url in the message body. I'm getting the e-mail but the url is mixed-up. Can anyone tell me what lines of code i need ?
0
quickbasicAuthor Commented:
Ps. for an example see the February newsletter from expert-exchange...
0
ozoCommented:
What are you getting in the email?
0
maneshrCommented:
try escaping the "Sp" chars in the URL

Eg.

print "http:\/\/www.postbank.nl\?test&test2";
0
guadalupeCommented:
First make sure your mail is a fully formatted html page.  Next use this subtitution on the html:

            #Change "=" To  "=3D" for HTML formatted mail
            $html =~ s/=/=3D/g;

This is necessary for maiul progs.  Don't know why.  Then use this format:


sub send_email($$$$$)
{

my($hostname,$address,$from_name,$from_address,$subject,$body) = @_;
#
# Connect to SMTP server.
#
$mailserv = new Net::SMTP($hostname, Debug => 1,);

unless ( $mailserv ) {
      &ErrorLog( "Could not connect to mail server $hostname; $!\n", $LOG_FILE );
}


#
# Format message.
#
$data = <<END;
From: "$from_name" <$from_address>
To: <$address>
Subject: $subject
MIME-Version: 1.0
Content-Type: multipart/alternative;
      boundary="----=_NextPart_000_000F_01BF381C.C17D0920"
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 4.72.3110.5
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3

This is a multi-part message in MIME format.

------=_NextPart_000_000F_01BF381C.C17D0920
Content-Type: text/plain;
      charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Plain Text

------=_NextPart_000_000F_01BF381C.C17D0920
Content-Type: text/html;
      charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

$body

END


#
# Send the message.
#
$mailserv->mail( $from_address );
$mailserv->to( $address );
$mailserv->data( $data );


#
# Close connection.
$mailserv->quit();

# smtp.pl
}


Where $body is the edited html page and Plain text is the plain text version of your mail for non html compliant mail progs...Not such an easy question after all.

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Perl

From novice to tech pro — start learning today.