1753781 Members
7570 Online
108799 Solutions
New Discussion юеВ

Re: sendmail question

 
ROSS HANSON
Regular Advisor

sendmail question

I have a list of emails and first and last names in a file currently. I want to put just the email addresses into an perl or bash array then loop through those email addresses. I have no clue how to start this. Could someone just get me started please?
Ross Hanson
2 REPLIES 2
Hoff
Honored Contributor

Re: sendmail question

Use of sendmail and bash implies Unix (wrong forum for that, this is the VMS forum and not the hot-bed of bash over here) and (if you have a Unix shell around) then a grep and maybe an awk might be the fastest way to extract the email addresses. Pipe the results of that script off to a file and Bob's your uncle.

Google finds the following for reading a file into an array

http://www.perlmonks.org/?node_id=19756
http://www.pageresource.com/cgirec/ptut14.htm

(and various other topics)

Google finds various Perl regexp processing libraries around and I'd be floored if there wasn't a Perl module or three or five that could be used here.

Here are some topics..

http://search.cpan.org/~dcoppit/Mail-Mbox-MessageParser-1.5002/lib/Mail/Mbox/MessageParser/Perl.pm

http://www.ex-parrot.com/pdw/Mail-RFC822-Address.html

http://perl.goeszen.com/simple-mbox-email-reader-in-perl.html

And I get (many) more hits for Google for:

http://www.google.com/search?hl=en&q=perl+email+address++mbox

Guessing that your mail is in mbox format with that Google query; that's common with various Unix platforms.

Stack Overflow and other sites are also good spots if you're just learning Perl.

And (of course) there are various books on Perl around.

http://oreilly.com/perl/index.html

Google being your BFF 4EVAH!!! FTW LOL.

Ok, that was too much... Sorry. I'm back now. :-)
ROSS HANSON
Regular Advisor

Re: sendmail question

Sorry, I just saw the "scripting" title and away I went
Thanks for the links I will be busy reading
Ross Hanson