Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

What mail program(s) come with the default active perl download? I need to get a simple contact form to work and Sendmail isn't available.

Replies are listed 'Best First'.
Re: mail servers
by marto (Cardinal) on Apr 06, 2006 at 15:23 UTC
    Anonymous Monk,

    Perl does not come with a mail server as part of the package.
    You should look at MIME::Lite for sending email.
    If you read the documentation you can see how to use this module to send email using a non sendmail mailserver:
    MIME::Lite->send('smtp', "smtp.myisp.net");
    You may need someone else to setup a mailserver for you, if you do not already have one.
    Should you need help installing modules, look at the Tutorials section of this site.

    Hope this helps.

    Martin
Re: mail servers
by idsfa (Vicar) on Apr 06, 2006 at 15:24 UTC

    Super Search is your friend. If you do not see a module for sending email listed, then your install doesn't contain one.

    Updated: For instance one of the responses in that thread tells you how to RTFM.


    The intelligent reader will judge for himself. Without examining the facts fully and fairly, there is no way of knowing whether vox populi is really vox dei, or merely vox asinorum. — Cyrus H. Gordon
Re: mail servers
by dorko (Prior) on Apr 06, 2006 at 15:28 UTC
    Well, to get you started, a list of modules available via PPM for the most current version of Active State Perl distribution can be found here. The modules listed in green are actually shipped with the distribution.

    Update: If you're using Windows, you might want to look at Blat.

    Cheers,

    Brent

    -- Yeah, I'm a Delt.
Re: mail servers
by displeaser (Hermit) on Apr 06, 2006 at 16:04 UTC
    Hi,

    Heres a small example using the Net::SMTP module. I think this is standard on most distros. Be aware that it just sends plain emails & you will have to use another module to send html/attachments.

    use Net::SMTP; my $smtp = Net::SMTP->new("10.10.100.200) || die "Couldnt reach the em +ail server\n"; $smtp->mail( "test\@test.ie" ); $smtp->to( "receiver\@helpme.com" ); $smtp->data(); $smtp->datasend("To: receiver\@helpme.com\n"); $smtp->datasend("From: test\@test.ie\n"); $smtp->datasend("Subject: blah blah blah\n"); $smtp->datasend("\n"); $smtp->datasend("lots of blah blah blah\n"); $smtp->dataend(); $smtp->quit();

    Hope this helps.
    Displeaser
      displeaser,

      A typeo:

      my $smtp = Net::SMTP->new("10.10.100.200) || die "Couldnt reach the email server\n";

      Should be:

      my $smtp = Net::SMTP->new("10.10.100.200") || die "Couldnt reach the email server\n";

      Hope this helps.

      Martin