C-Keen has asked for the wisdom of the Perl Monks concerning the following question:

I am playing with the idea of programming a gnome applet capable of mailing given notes or ideas to a given group of people. The e-mail has to be sent through my ISP's mail server so it would be nice if some module exists that can handle the necessary protocols. Can anyone help me with that?

C-Keen

2001-03-16 Edit by Corion: Moved to SOPW

Replies are listed 'Best First'.
Re: Module for smtp mail server?
by archon (Monk) on Mar 16, 2001 at 12:04 UTC
    There are many modules in the Mail::* hierarchy. Check out Mail::Send to start. See the CPAN index for the rest.
Re: Module for smtp mail server?
by Adam (Vicar) on Mar 16, 2001 at 14:09 UTC
    Check out Libnet, which includes Net::SMTP.
    Whenever you need a module, try CPAN first.
Re: Module for smtp mail server?
by LiTinOveWeedle (Scribe) on Mar 16, 2001 at 16:49 UTC
    Here is all soubroutines which I write to my script.
    use Net::SMTP; $from = "SMSrobot"; $to = "me\@mydomai.com"; $smtp_retry = "3"; $smtp_timeout = "60"; $smtp_server = "smtp.provider.com"; # -------------------------------------------------------------------- +----- #sub smtp sub smtp { my ( $message ) = @_[0]; &logging("Conecting to $smtp_server SMTP server..."); unless ( $smtp = Net::SMTP->new( $smtp_server, Hello => $from, Tim +eout => $smtp_timeout ) ) { &logging("Can't connect."); return 0; } &logging("Conected."); unless ( $smtp->mail( $from ) and $smtp->to( $to ) ) { &logging("Can't initialize communication"); return 0; } &logging("Sending mail to $to"); unless ( $smtp->data() and $smtp->datasend("$message\n") and $smtp +->dataend() and $smtp->quit) { &logging("Can't send data."); return 0; } $message =~ s/\s/ /isg; &logging("Message: \"$message\" was sent."); &logging("Quit."); return 1; }
    Just call this by &smtp('mail message');
      I have used Mail::Sendmail for a long time now to handle emailing of sorts. Ultra simple:
      use Mail::Sendmail; my %message = (To => "some address", From => "your address", Subject => "subject", Message => "text"); sendmail(%message) or die $Mail::Sendmail::error;
      That's it. Set up your smtp server(s) in Sendmail.pm in %mailcfg at the top.