Mailing List ArchiveSupport open source code!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: tlug: When Perl can't open it can it mail it?
- To: tlug@example.com
- Subject: Re: tlug: When Perl can't open it can it mail it?
- From: Takeshi Hakamada <hakamada@example.com>
- Date: Fri, 02 Oct 1998 14:15:46 +0900 (JST)
- Content-Transfer-Encoding: 7bit
- Content-Type: Text/Plain; charset=us-ascii
- In-Reply-To: Your message of "Fri, 02 Oct 1998 12:04:01"<3.0.6.32.19981002120401.009b2350@example.com>
- References: <3.0.6.32.19981002120401.009b2350@example.com>
- Reply-To: tlug@example.com
- Sender: owner-tlug@example.com
Yes, you can send mail with Perl script. If you want to use sendmail, you need to write some required headers like this: open(MAIL,"|/usr/lib/sendmail -t") || die("Can't open /usr/lib/sendmail"); print MAIL "To: someone\@example.com"; print MAIL "From: me\@example.com"; print MAIL "Subject: testing testing...\n"; print MAIL "\n"; print MAIL "$message\n"; close(MAIL); Or, you can use mail command like this: open(MAIL, "|mail $mailto") || die("Can't open mail"); print MAIL "$message\n"; close(MAIL); Hope it helps. Takeshi From: Darren Cook <darren@example.com> Message-ID: <3.0.6.32.19981002120401.009b2350@example.com> > Is it possible to have it write the information to an email when it can't > open the file? Eg. something like this: > > ----------- > unless (open(FOUT,">>$file")) { > open(FOUT,"|sendmail darren"); > print FOUT "Subject: Perl script couldn't open $file \n\n"; > #Fall through > } > #Write here > close(FOUT); > ----------- > > Are there any security issues I need to be aware of here? > > Darren > > --------------------------------------------------------------- > Next Meeting: 10 October, 12:30 Tokyo Station Yaesu central gate > Featuring the IMASY Eng. Team on "IPv6 - The Next Generation IP" > Next Nomikai: 20 November, 19:30 Tengu TokyoEkiMae 03-3275-3691 > --------------------------------------------------------------- > Sponsor: PHT, makers of TurboLinux http://www.pht.co.jp --------------------------------------------------------------- Next Meeting: 10 October, 12:30 Tokyo Station Yaesu central gate Featuring the IMASY Eng. Team on "IPv6 - The Next Generation IP" Next Nomikai: 20 November, 19:30 Tengu TokyoEkiMae 03-3275-3691 --------------------------------------------------------------- Sponsor: PHT, makers of TurboLinux http://www.pht.co.jp
- Follow-Ups:
- Re: tlug: When Perl can't open it can it mail it?
- From: Scott Stone <sstone@example.com>
- References:
- tlug: When Perl can't open it can it mail it?
- From: Darren Cook <darren@example.com>
Home | Main Index | Thread Index
- Prev by Date: tlug: hard disk failure
- Next by Date: tlug: how to unsubscribe
- Prev by thread: tlug: When Perl can't open it can it mail it?
- Next by thread: Re: tlug: When Perl can't open it can it mail it?
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links