OK, this probably sounds really basic for you guys, but I just can't figure it out. I am making a mailing list, and I am going to include personalised messages. I am using "| |" as a delimeter between the email and the name, so the text file ends up looking like this.
something@somewhere.com| |Michael
you@your.com| |Samuel
I have to seperate the two so when I open the mailprog, and I can send out everyone a message, using a foreach statement.
SO far I have come up with this, not sure if I am even close.
sub getemails {
#Now we have all the addresses.
open(DATA, ">>$mainpath/emails.txt")| |
&error("The text files to store the email addresses does not exist.");
@emailaddress = <EMAILADDRESS>;
close(DATA);
@emailaddress = split (/| |/);
}
&getemails;
foreach $recip (@emailaddress) {
#Send A Message.
open (MAIL, "|$mailprog") | | die "Can't open $mailprog!\n";
print MAIL "To: $recip\n";
and so on with the mailprog etc which I know works.
Any help would be GREATLY appreciated! Thanks alot.
something@somewhere.com| |Michael
you@your.com| |Samuel
I have to seperate the two so when I open the mailprog, and I can send out everyone a message, using a foreach statement.
SO far I have come up with this, not sure if I am even close.
sub getemails {
#Now we have all the addresses.
open(DATA, ">>$mainpath/emails.txt")| |
&error("The text files to store the email addresses does not exist.");
@emailaddress = <EMAILADDRESS>;
close(DATA);
@emailaddress = split (/| |/);
}
&getemails;
foreach $recip (@emailaddress) {
#Send A Message.
open (MAIL, "|$mailprog") | | die "Can't open $mailprog!\n";
print MAIL "To: $recip\n";
and so on with the mailprog etc which I know works.
Any help would be GREATLY appreciated! Thanks alot.