Find that here. May by useful for you

#!/usr/bin/perl -w

#
# Pass two filenames one for emailaddress and the other for the email message
# In my example that file is comma separated email address and the full
name with one per line
# each line is like
# [EMAIL PROTECTED],"Recipient Name"
#
# the body has two placeholder patterns __FIRST_NAME__ and __TO_ADDRESS__
# this program is just doing a string replacement for each.
#

#
# Set this Up First
#

my $sendmail = '/usr/sbin/sendmail';
my $senderFullName = 'My Name';
my $senderaddress = '[EMAIL PROTECTED]'

#
# Actual program start here.
#

my ($addresses, $body) = ($ARGV[0], $ARGV[1]);

#
# Sorry I did not do any errot checking do it on your end whatever you
think it is necessary
# basically don't forget to pass the address file and the email message file
#

my @emailAddress;

if(!(open(EMAILADDR, "< $addresses"))) {die "Sorry cannot open file for
reading in email addr: $!";}
@emailAddress = <EMAILADDR>;
close EMAILADDR;

if(!(open(EMAILTEXT, "< $body"))) {die "Sorry cannot open file for reading
in emailtext: $!";}
my $emailTextMesg = join('', <EMAILTEXT>);
close EMAILTEXT;

for $addr (@emailAddress)
{
        chomp($addr);
        $addr =~ s/\s+$//g;

        my ($email, $fname) = split(',', $addr);

        $emailTextMesg =~ s/__FIRST_NAME__/$fname/g;
        $emailTextMesg =~ s/__TO_ADDRESS__/"$fname" <$email>/g;

        print $addr."\n";
        system("$sendmail -F '$senderFullName' -f $senderaddress $email
<<EOF\n$emailTextMesg\nEOF\n");
}

1;


> Hi,
>
> I have to send mail to a group of addresses so that each one sees
> only his/her address in the To field. Can I do this with mutt? I could
> not find this aspect discussed in mutt docs. Can somebody point me to
> the proper place for achieving this?
>
> Regards,
>
> --
> Sridhar M.A.
>
> The profession of book writing makes horse racing seem like a solid,
> stable business.
>               -- John Steinbeck
>       [Horse racing *is* a stable business ...]
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by: Dice - The leading online job board
> for high-tech professionals. Search and apply for tech jobs today!
> http://seeker.dice.com/seeker.epl?rel_code=31
> _______________________________________________
> linux-india-help mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/linux-india-help





-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
linux-india-help mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/linux-india-help

Reply via email to