in reply to mail servers

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

Replies are listed 'Best First'.
Re^2: mail servers
by marto (Cardinal) on Apr 07, 2006 at 08:41 UTC
    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