CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Need a Custom or Prewritten Perl Program?: I need a program that...:
want link to be sent in mail body that will open file on remote system

 



nagarajsh
New User

Jul 31, 2009, 2:32 PM

Post #1 of 5 (2853 views)
want link to be sent in mail body that will open file on remote system Can't Post

Hi,

I have script that will find the latest report file created (reports are generated everyday) and sends mail to recipients the link to that file. But the problem is the link is too long, file://systemip/folder1/folder2/folder3/abcdefghijklmnop.xls. i want to send mail with "LINK1" in place of this whole string. i tried <a href= ></a>, it did not work. please help me.

thanks in advance,

Naga


KevinR
Veteran


Jul 31, 2009, 2:38 PM

Post #2 of 5 (2851 views)
Re: [nagarajsh] want link to be sent in mail body that will open file on remote system [In reply to] Can't Post

Post the part of your code that you tried to convert the long link into a short link, and explain what "did not work" actually means.
-------------------------------------------------


nagarajsh
New User

Jul 31, 2009, 2:49 PM

Post #3 of 5 (2850 views)
Re: [KevinR] want link to be sent in mail body that will open file on remote system [In reply to] Can't Post

Hi Kevin,

here is part of my script,

use SendMail;
$smtpserver = "120.12.145.41";
$smtpport = 25;
$sender = "Naga<math\@yahoo.com>";
$recipient = "ABC<math1\@yahoo.com>";




$sm = new SendMail($smtpserver,$smtpport);
$sm->setDebug($sm->ON);
$sm->From($sender);
$sm->Subject("Reports Link");


$sm->To($recipient);

$sm->setMailBody("please click the following link to get the reports\n\n <a href=""\\\\111.1.34.100\\ABC\\Reports\\BCD\\Details\\MNO\$latest_bb_xls">click here</a>");

if ($sm->sendMail() != 0) {
print $sm->{'error'}. "\n";
exit -1;
}
print "Done\n";
exit 0;





When i run this, i get mail and the it displays "please click the following link to get the reports\n\n <a href=""\\\\111.1.34.100\\ABC\\Reports\\BCD\\Details\\MNO\$latest_bb_xls">click here</a>"

:(


KevinR
Veteran


Jul 31, 2009, 4:06 PM

Post #4 of 5 (2846 views)
Re: [nagarajsh] want link to be sent in mail body that will open file on remote system [In reply to] Can't Post

I am not familiar with the SendMail module, does it have any encoding options? If you want an email to use html widgets you would normally have to send it as html encoded.
-------------------------------------------------


FishMonger
Veteran / Moderator

Jul 31, 2009, 5:24 PM

Post #5 of 5 (2844 views)
Re: [nagarajsh] want link to be sent in mail body that will open file on remote system [In reply to] Can't Post

My choice would be to use MIME::Lite
http://search.cpan.org/~rjbs/MIME-Lite-3.024/lib/MIME/Lite.pm

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives