Perl Script to send mail with Attachment
Hi ScriptKings, Im a newbie in Perl, Would like to know following Info: Can we create Perl Scipt to send Mails with Attachments Any Tips, Help, Code,Suggestions Guidance are Welcome Regards,Satish Do you Yahoo!?SBC Yahoo! - Internet access at a great low price.___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Perl Script to send mail with Attachment
Try this: $mailer = MIME::Lite-new( From = $from, To = $to, Subject = $subject, Type = 'multipart/mixed' ); $mailer-attach(Type ='TEXT', Data ="" $emailbody); $mailer-attach(Type ='TEXT', Path = $anAttachment, Disposition = 'attachment', ); $mailer-send('smtp', $ENV{SMTP_SERVER}, Timeout=60); --Wenjie Wang(a.k.a. William) [EMAIL PROTECTED]WANG Infonology Systems Ph:(02)-98712018; mob:0412688380http://users.bigpond.net.au/WISeAgent==This e-mail is confidential and may contain legally privileged information. You should not disclose its contents to any other person. If you are not the intended recipient, please notify the sender immediately.Whilst every reasonable precaution has been taken to minimise the risk of computer software viruses, it cannot accept liability for any damage which you may sustain as a result of such viruses. You should carry out your own virus checks before opening the e-mail (and/or any attachments). -Original Message-From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Satish KumarSent: Friday, 14 May 2004 9:26 PMTo: [EMAIL PROTECTED]Subject: Perl Script to send mail with Attachment Hi ScriptKings, Im a newbie in Perl, Would like to know following Info: Can we create Perl Scipt to send Mails with Attachments Any Tips, Help, Code,Suggestions Guidance are Welcome Regards,Satish Do you Yahoo!?SBC Yahoo! - Internet access at a great low price. ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Perl Script to send mail with Attachment
Hi Satish, Satish Kumar wrote: Hi ScriptKings, Im a newbie in Perl, Would like to know following Info: Can we create *Perl Scipt to send Mails with Attachments* Any Tips, Help, Code,Suggestions Guidance are Welcome The module Mail::Sender is probaply what you are looking for... This is a subroutine I use to send a logfile from a Windows-Box. sub SendMail { # What mail error or okay? my ( $Action ); ( $Action ) = @_; if ( $Action eq ERROR ) { $note = ALERT: blablabla; } elsif ( $Action eq OKAY ) { $note = NOTE: blablabla; } $Msg = See attached file for more details.\n; if ( $Sender = Mail::Sender-new( {smtp = 'scmail', from = 'serv-int'} ) ) { } else { End ( FAILED ); } if ( $Sender-MailFile( { to = 'apprich', subject = $note, msg = $Msg, file= $LogFile} ) ) { } } Regards, Satish HTH Alex ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Filehandle Question
It occurs because the only kind of variable allowed for specifying the filehandle is a scalar--no array or hash elements. There are (or course) several solutions. One is actually documented in the entry for print in perlfunc: print({$Self-{FH}} $TimeStamp$LogMsg\n); Another possibility is documented in FileHandle's documentation: $Self-{FH}-print($TimeStamp$LogMsg\n); -- Eric Amick Columbia, MD I'd like to thank Eric for his first suggestion, which I arrived at shortly after posting the question. One thing I find curious about the way the filehandle has to be specified for the print function is that the special notation using {} around the filehandle reference for the print function is not required for the open and close functions. For example: die(Unable to open $LogFile $!, stopped) unless (open($Self-{FH},$Str)); die(Close failed for filehandle $Self-{FH}) unless(close($Self-{FH})); This may or may not be a moot point concerning the future evolution of Perl, but I still find it curious that the filehandle references cannot be specified in the same format for the print and open or close functions. ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Automating a HTML request....
On 13 May 2004, at 03:39 PM, George Gallen wrote: Not sure how to go about this, or which modules to best use. I need to first request a web page, then post that form with a value filled in. Basically, nightly we want to poll a vendor with out orders to complete a report for the am that details their progress in the ordering stage. The only option the vendor has is you can go to URL, type in the order# and submit that page, and then resulting page will contain the data you need. getting the results from the initial URL is no problem. What I don't know is how do then submit the form? Is there a way to find out what data the browser is sending back to make sure that all the fields I need are supplied? Unless you need to get a cookie or something, you probably don't need to get the first page. The field is probably fixed in name, so you really just need to send a POST request with the proper values. Look at LWP -- I think the default UserAgent you create can do this. HTH, Ricky ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Retrieve process list
Hi perler's. I'v the need to test the existence of a process running on some W2K boxes and the status of some services . In order to do so it is possible to run, using a script, some utilityes like sc.exe and pslist.exe and retrieve the stdout. My questions are: it is possible to use some perl package to do so ? someone have some example ? I'v looked in Active perl documentation and in last 3 year of mailing list but I'v found nothing. Many tank's for your time cheers Gianvittorio ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Retrieve process list
Yes there is loads of stuff... Win32::Process Win32::OLE WMI or you can handily download a module which does Starting/Listing/Killing of processes from here: http://www.perlmonks.org/index.pl?node_id=336024 Kind regards, Mark Anderson SMS Deployment The Royal Bank of Scotland 113 Dundas Street, Edinburgh, EH3 5DE http://www.manufacturing.rbs.co.uk/GTrswi/ -Original Message- From: Gianvittorio Negri [SMTP:[EMAIL PROTECTED] Sent: Friday, May 14, 2004 3:25 PM To: [EMAIL PROTECTED] Subject: Retrieve process list *** WARNING : This message originates from the Internet *** Hi perler's. I'v the need to test the existence of a process running on some W2K boxes and the status of some services . In order to do so it is possible to run, using a script, some utilityes like sc.exe and pslist.exe and retrieve the stdout. My questions are: it is possible to use some perl package to do so ? someone have some example ? I'v looked in Active perl documentation and in last 3 year of mailing list but I'v found nothing. Many tank's for your time cheers Gianvittorio ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs The Royal Bank of Scotland plc, Registered in Scotland No. 90312. Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB The Royal Bank of Scotland plc is authorised and regulated by the Financial Services Authority and represents The Royal Bank of Scotland Marketing Group. The Bank sells life policies, collective investment schemes and pension products and advises only on the Marketing Group's range of these products and on a With-Profit Bond produced by Norwich Union Life (RBS) Limited. This e-mail message is confidential and for use by the addressee only. If the message is received by anyone other than the addressee, please return the message to the sender by replying to it and then delete the message from your computer. Internet e-mails are not necessarily secure. The Royal Bank of Scotland plc does not accept responsibility for changes made to this message after it was sent. Whilst all reasonable care has been taken to avoid the transmission of viruses, it is the responsibility of the recipient to ensure that the onward transmission, opening or use of this message and any attachments will not adversely affect its systems or data. No responsibility is accepted by The Royal Bank of Scotland plc in this regard and the recipient should carry out such virus and other checks as it considers appropriate. ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Unistall Perl module
Hi, I need to uninstall a particular Perl module which was installed in the following way: perl Makefile.pl nmake nmake install How it can be done ? Thanks in advance, Artem. ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Reading a file then going back a line.
Guys, I have a script that reads a file line by line, looking for a start tag. When it finds one, it jumps to a processing routing that continues through the file, line by line until it reaches an end tag. Then it carries on looking for a start tag. I have just found a scenario where a start tag occurrs before an end tag. Initially, I thought I could simple use the start tag as an additional end tag, but the problem is that when it drops out of the processing loop, it will read the NEXT line of the file and miss the start tag. Is there a way of pointing to the previous line of the input file if I detect a start tag? Thanks, R. Sample code, untested. open (INPUT, $myfile); while (INPUT) { chomp; insert() if /Start Tag/; } sub insert { while (INPUT) { last if /Tag Stop/; if /Tag Start/ { somehow point to the previous line of INPUT so that the start tag will be found on returning. last; } do stuff; } } ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs