Web Hosting Talk







View Full Version : perl mutt emails


amazer
04-01-2004, 10:56 PM
I need help emailing from a perl script.
I want to get addresses from a database and send out emails using mutt. Getting the addresses is fine, but am having difficulty composing the messages. I have checked all man pages I can find but all assume I am working form a terminal.

I wnat to do something like
`mutt -s test -i mail.txt $email`
any help much appreciated.

sung
04-02-2004, 02:55 AM
>I wnat to do something like
>`mutt -s test -i mail.txt $email`
> any help much appreciated.

what you want to do is open a pipe to mutt

open MUTT,"|mutt -s test $email" or die "cannot open pipe to mutt: $!\n";
print MUTT $message;
close MUTT or die "not right: $?\n";

amazer
04-02-2004, 03:53 AM
Thanks that is excellent. Much better looking than the solution I had stumbled across. It looks ok here I guess but when its supposed to be indented... sucky.

`mutt -s "uni assignment - disregard" $email <<EMAIL
big blocks
of text
as the
email
EMAIL`;

sung
04-02-2004, 04:20 PM
it has been my pleasure.

*curtsy*