Can you do something like this, And if you can what does the $smtp->mail('[EMAIL PROTECTED]') line represent.
use Net::SMTP; use strict; @contact[0]=(name=>'John Doe',email=>[EMAIL PROTECTED],); @contact[1]=(name=>'Anita coffin',email=>[EMAIL PROTECTED]); my data ''; data .="To: Primary Contact"; data .="Subject Automated Alert; data .="\n"; data .="Hello @contact[0]{name},@contact[1]{name}, \n"; data .="This is an automated alert to let you know that\n"; data .="An error has occoured in the specified file\n"; data .="Please address the problem immediatly\n"; my $smtp= Net::SMTP->new('mailserver'); $smtp->mail('[EMAIL PROTECTED]'); $smtp->(@contact[0]{email},@contact[1]{email}); $smtp->data([$data]) $smtp->quit; thanks, William >From: Nikola Janceski <[EMAIL PROTECTED]> >To: Nikola Janceski <[EMAIL PROTECTED]>, 'William Black' ><[EMAIL PROTECTED]>, [EMAIL PROTECTED] >Subject: RE: Few Questions >Date: Mon, 8 Jul 2002 12:20:31 -0400 > >OOOPPSSS... I forgot the $ >see below > > > > -----Original Message----- > > From: Nikola Janceski [mailto:[EMAIL PROTECTED]] > > Sent: Monday, July 08, 2002 12:17 PM > > To: 'William Black'; [EMAIL PROTECTED] > > Subject: RE: Few Questions > > > > > > See in-line reply below > > > > > -----Original Message----- > > > From: William Black [mailto:[EMAIL PROTECTED]] > > > Sent: Monday, July 08, 2002 12:04 PM > > > To: [EMAIL PROTECTED] > > > Subject: RE: Few Questions > > > > > > > > > > > > Hi all, > > > > > > I have a few short questions: > > > > > > First, How do you make an array of hashes and access them > > > once you have > > > created them. > > > > This is a little difficult for a beginner but I will give you > > the basic > > basics: > > you have an array @a > > now you want to have @a[0] have a hash of values: > > @a[0] = ( key1 => value1, > > key2 => value2 ); > > > > to get key1's value: @a[0]{key1} > >should be $$a[0]{key1} > > > now another way to add to it. > > > > foreach my $key ( qw(key1 key2) ){ > > @a[1]{$key} = 100; >should be $$a[1]{$key} > > > } > > > > print "@a[1]{key2}\n"; ## will print 100; > > print "@a[0]{key2}\n"; ## will print value2; > >you get the idea of my mistakes. > > > > > get it? > > > > > > > > Next,How would email someone from within a perl pgm. I want > > > to email more > > > than one person at the same time. The script is running on a > > > unix box, but > > > the people receiving the emails can be on a differentOS(i.e > > > windows NT, > > > ETC). > > > > use any of the following modules: > > Net::SMTP > > Mail::Sender > > MIME::Entity > > > > and for the TO or CC just separate the various e-mail with a > > comma (,): > > [EMAIL PROTECTED], [EMAIL PROTECTED] > > > > or > > > > Got Jack <[EMAIL PROTECTED]>, Bill GotNone <[EMAIL PROTECTED]> > > > > > > > > > > > > > > > > Thanks, > > > > > > William Black > > > > > > > > > > > > _________________________________________________________________ > > > Join the world's largest e-mail service with MSN Hotmail. > > > http://www.hotmail.com > > > > > > > > > -- > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > -------------------------------------------------------------- > > -------------- > > -------------------- > > The views and opinions expressed in this email message are > > the sender's > > own, and do not necessarily represent the views and opinions of Summit > > Systems Inc. > > > > > > -- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > >---------------------------------------------------------------------------- >-------------------- >The views and opinions expressed in this email message are the sender's >own, and do not necessarily represent the views and opinions of Summit >Systems Inc. > > >-- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] William Black _________________________________________________________________ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]