Article View: pl.comp.lang.perl
Article #723Re: prosty mailer
From: Robert Richard George 'reptile' ...
Date: Wed, 26 Nov 1997 11:03
Date: Wed, 26 Nov 1997 11:03
47 lines
2739 bytes
2739 bytes
Mariusz Krukowski wrote:
> > Tak na marginesie, czy ktos juz wysylal poczte z perla
> > telnetem na port 25 innego hosta?
> > Interesuje mnie stabilnosc takiego rozwiazania.
> Problem tylko w tym, ze trzeba by zaimplementowac samemu
> protokol SMPT, lub lepiej ESMTP. O ile pamietam jest
> gotowy modlul do Perla Inet::SMTP, ktory prawdopodobnie
> do tego sluzy, ale jeszcze go nie uzywalem.
Dokladniej Net::SMTP . Przykladowy fragment programu:
8<---
use Net::SMTP;
sub send {
local($me,$myhost,@rcpt)=@_;
local($email,$time);
$time=time;
$email = <<EOF;
Message-ID: <$time\@$myhost>
From: $me\@$myhost
To: $me\@$myhost
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
$body
EOF
$smtp=Net::SMTP->new('plearn.edu.pl', Hello=>$myhost,Debug=>1);
$smtp->mail("$me\@$myhost");
foreach $whom (@rcpt) {
$smtp->to($whom);
}
$smtp->data($email);
$smtp->quit();
}
8<---
Gad
--
mailto:reptile@pdi.net :)
Women are more complicated than PC... :(
Look into my headers and you'll see who I am. :)
Technical Details
Message-ID:
<65gvmu$jc3$1@helios.man.lublin.pl>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!pingwin.icm.edu.pl!mat.uni.torun.pl!uw.edu.pl!lublin.pl!gryzmak.lodz.pdi.net!reptileReferences:
<65428n$qmf$1@galaxy.uci.agh.edu.pl> <Pine.LNX.3.95.971122212102.3318B-200000@wizard.ae.krakow.pl> <6586sr$ctm$1@galaxy.uci.agh.edu.pl> <347851BE.7F82@baunet.de> <659ucu$lte$1@galaxy.uci.agh.edu.pl> <34796F55.7260@baunet.de> <65cvds$dip$1@galaxy.uci.agh.edu.pl> <347BE797.6B07@baunet.de> <347BF0CF.EFFC6F89@it.pl>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!pingwin.icm.edu.pl!mat.uni.torun.pl!uw.edu.pl!lublin.pl!gryzmak.lodz.pdi.net!reptile From: Robert Richard George 'reptile' Wal <gad@address.in.sig> Newsgroups: pl.comp.lang.perl Subject: Re: prosty mailer Date: 26 Nov 1997 11:03:58 GMT Lines: 47 Message-ID: <65gvmu$jc3$1@helios.man.lublin.pl> References: <65428n$qmf$1@galaxy.uci.agh.edu.pl> <Pine.LNX.3.95.971122212102.3318B-200000@wizard.ae.krakow.pl> <6586sr$ctm$1@galaxy.uci.agh.edu.pl> <347851BE.7F82@baunet.de> <659ucu$lte$1@galaxy.uci.agh.edu.pl> <34796F55.7260@baunet.de> <65cvds$dip$1@galaxy.uci.agh.edu.pl> <347BE797.6B07@baunet.de> <347BF0CF.EFFC6F89@it.pl> NNTP-Posting-Host: gryzmak.lodz.pdi.net X-URL: http://www.pdi.net/~gad (Eternally under construction) X-IRC-Nick: Gadzinka@efnet.irc X-Phone: +48 (0) 42 368266 X-PGP-Fingerprint: CB0A7A3B 71EF8475 1F1B5981 3C3A1A65 X-PGP-Key: finger reptile@gryzmak.lodz.pdi.net X-Motto: Fact that you're paranoid doesn't imply that THEY don't follow you. X-Disclaimer: This message is directed to people whose addresses appear in TO and CC fields including (and limited to) alias expansion, mailing lists and newsgroups. This means that these are THE ONLY people that I wanted to share the opinions contained herein with. X-Another-Disclaimer: I don't answer e-mail or news articles below some arbitrary mark. X-Favourites: women, Sisters of Mercy, black cats, Amiga, Linux, TeX, vim, books, poetry (in random or everchanging order) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit