English 中文(简体)
Perl Net:SMTP - How use
原标题:Perl Net::SMTP - How to use
  • 时间:2011-11-01 21:07:50
  •  标签:
  • perl
  • smtp

奥凯,我刚刚用了最后四小时的时间,试图说明为什么我实施“网:马普切计划”模块不再工作。

简言之,我这样做(消除错误,为清晰度检查):

 my $smtp = Net::SMTP->new(Host => $host);
 $smtp->send($from);
 $smtp->data;
 $smtp->datasend($message);
 $smtp->dataend;
 $smtp->quit;

在此之前,我一直在努力:

Net::SMTP=GLOB(0x7f9893114798)>>> SEND FROM:<[email protected]>
Net::SMTP=GLOB(0x7f9893114798)<<< 450 Unable to send to "<[email protected]" at this time

这源自我的<代码>send方法。

The Perldoc wasn t too much of a help because the send, send_and_mail, send_or_mail, and mail commands are all described together, and I had assumed were pretty much aliases of each other.

我研究了其他例子,并决定尝试$smtp->mail 而不是$smtp->send。 这样做了。

因此,<代码>send、>、、>send_and_mailsend_or_mail方法之间有何区别? 我是否需要逐一尝试? 我知道它们与《SENDSOSAML在员工和管理当局协调处的指挥一致,但我确实能够发现任何东西能告诉我这些差异。 而且,不同的员工和管理当局协调会服务器使用不同的指挥系统。 (5月改为<代码>send 以前使用的方法?

最佳回答
问题回答

http://www.rfc-editor.org/rfc/rfc5321#appendix-F.6"rel=“nofollow noreferer”>RFC 5321, 附录F.6:

"In addition to specifying a mechanism for delivering messages to user s mailboxes, RFC 821 provided additional, optional, commands to deliver messages directly to the user s terminal screen. These commands (SEND, SAML, SOML) were rarely implemented, and changes in workstation technology and the introduction of other protocols may have rendered them obsolete even where they are implemented.

"Clients SHOULD NOT provide SEND, SAML, or SOML as services. Servers MAY implement them. If they are implemented by servers, the implementation model specified in RFC 821 MUST be used and the command names MUST be published in the response to the EHLO command."





相关问题
Why does my chdir to a filehandle not work in Perl?

When I try a "chdir" with a filehandle as argument, "chdir" returns 0 and a pwd returns still the same directory. Should that be so? I tried this, because in the documentation to chdir I found: "...

How do I use GetOptions to get the default argument?

I ve read the doc for GetOptions but I can t seem to find what I need... (maybe I am blind) What I want to do is to parse command line like this myperlscript.pl -mode [sth] [inputfile] I can use ...

Object-Oriented Perl constructor syntax and named parameters

I m a little confused about what is going on in Perl constructors. I found these two examples perldoc perlbot. package Foo; #In Perl, the constructor is just a subroutine called new. sub new { #I ...

Where can I find object-oriented Perl tutorials? [closed]

A Google search yields a number of results - but which ones are the best? The Perl site appears to contain two - perlboot and perltoot. I m reading these now, but what else is out there? Note: I ve ...