⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 net::smtp.3

📁 视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.
💻 3
📖 第 1 页 / 共 2 页
字号:
Example:.Sp.Vb 5\&    $smtp = Net::SMTP\->new(\*(Aqmailhost\*(Aq,\&                           Hello => \*(Aqmy.mail.domain\*(Aq,\&                           Timeout => 30,\&                           Debug   => 1,\&                          );\&\&    # the same\&    $smtp = Net::SMTP\->new(\&                           Host => \*(Aqmailhost\*(Aq,\&                           Hello => \*(Aqmy.mail.domain\*(Aq,\&                           Timeout => 30,\&                           Debug   => 1,\&                          );\&\&    # Connect to the default server from Net::config\&    $smtp = Net::SMTP\->new(\&                           Hello => \*(Aqmy.mail.domain\*(Aq,\&                           Timeout => 30,\&                          );.Ve.SH "METHODS".IX Header "METHODS"Unless otherwise stated all methods return either a \fItrue\fR or \fIfalse\fRvalue, with \fItrue\fR meaning that the operation was a success. When a methodstates that it returns a value, failure will be returned as \fIundef\fR or anempty list..IP "banner ()" 4.IX Item "banner ()"Returns the banner message which the server replied with when theinitial connection was made..IP "domain ()" 4.IX Item "domain ()"Returns the domain that the remote \s-1SMTP\s0 server identified itself as duringconnection..IP "hello ( \s-1DOMAIN\s0 )" 4.IX Item "hello ( DOMAIN )"Tell the remote server the mail domain which you are in using the \s-1EHLO\s0command (or \s-1HELO\s0 if \s-1EHLO\s0 fails).  Since this method is invokedautomatically when the Net::SMTP object is constructed the user shouldnormally not have to call it manually..IP "host ()" 4.IX Item "host ()"Returns the value used by the constructor, and passed to IO::Socket::INET,to connect to the host..IP "etrn ( \s-1DOMAIN\s0 )" 4.IX Item "etrn ( DOMAIN )"Request a queue run for the \s-1DOMAIN\s0 given..IP "auth ( \s-1USERNAME\s0, \s-1PASSWORD\s0 )" 4.IX Item "auth ( USERNAME, PASSWORD )"Attempt \s-1SASL\s0 authentication..IP "mail ( \s-1ADDRESS\s0 [, \s-1OPTIONS\s0] )" 4.IX Item "mail ( ADDRESS [, OPTIONS] )".PD 0.IP "send ( \s-1ADDRESS\s0 )" 4.IX Item "send ( ADDRESS )".IP "send_or_mail ( \s-1ADDRESS\s0 )" 4.IX Item "send_or_mail ( ADDRESS )".IP "send_and_mail ( \s-1ADDRESS\s0 )" 4.IX Item "send_and_mail ( ADDRESS )".PDSend the appropriate command to the server \s-1MAIL\s0, \s-1SEND\s0, \s-1SOML\s0 or \s-1SAML\s0. \f(CW\*(C`ADDRESS\*(C'\fRis the address of the sender. This initiates the sending of a message. Themethod \f(CW\*(C`recipient\*(C'\fR should be called for each address that the message is tobe sent to..SpThe \f(CW\*(C`mail\*(C'\fR method can some additional \s-1ESMTP\s0 \s-1OPTIONS\s0 which is passedin hash like fashion, using key and value pairs.  Possible options are:.Sp.Vb 8\& Size        => <bytes>\& Return      => "FULL" | "HDRS"\& Bits        => "7" | "8" | "binary"\& Transaction => <ADDRESS>\& Envelope    => <ENVID>     # xtext\-encodes its argument\& ENVID       => <ENVID>     # similar to Envelope, but expects argument encoded\& XVERP       => 1\& AUTH        => <submitter> # encoded address according to RFC 2554.Ve.SpThe \f(CW\*(C`Return\*(C'\fR and \f(CW\*(C`Envelope\*(C'\fR parameters are used for \s-1DSN\s0 (DeliveryStatus Notification)..SpThe submitter address in \f(CW\*(C`AUTH\*(C'\fR option is expected to be in a format asrequired by \s-1RFC\s0 2554, in an RFC2821\-quoted form and xtext-encoded, or <> ..IP "reset ()" 4.IX Item "reset ()"Reset the status of the server. This may be called after a message has been initiated, but before any data has been sent, to cancel the sending of themessage..IP "recipient ( \s-1ADDRESS\s0 [, \s-1ADDRESS\s0, [...]] [, \s-1OPTIONS\s0 ] )" 4.IX Item "recipient ( ADDRESS [, ADDRESS, [...]] [, OPTIONS ] )"Notify the server that the current message should be sent to all of theaddresses given. Each address is sent as a separate command to the server.Should the sending of any address result in a failure then the process isaborted and a \fIfalse\fR value is returned. It is up to the user to call\&\f(CW\*(C`reset\*(C'\fR if they so desire..SpThe \f(CW\*(C`recipient\*(C'\fR method can also pass additional case-sensitive \s-1OPTIONS\s0 as ananonymous hash using key and value pairs.  Possible options are:.Sp.Vb 3\&  Notify  => [\*(AqNEVER\*(Aq] or [\*(AqSUCCESS\*(Aq,\*(AqFAILURE\*(Aq,\*(AqDELAY\*(Aq]  (see below)\&  ORcpt   => <ORCPT>\&  SkipBad => 1        (to ignore bad addresses).Ve.SpIf \f(CW\*(C`SkipBad\*(C'\fR is true the \f(CW\*(C`recipient\*(C'\fR will not return an error when a badaddress is encountered and it will return an array of addresses that didsucceed..Sp.Vb 5\&  $smtp\->recipient($recipient1,$recipient2);  # Good\&  $smtp\->recipient($recipient1,$recipient2, { SkipBad => 1 });  # Good\&  $smtp\->recipient($recipient1,$recipient2, { Notify => [\*(AqFAILURE\*(Aq,\*(AqDELAY\*(Aq], SkipBad => 1 });  # Good\&  @goodrecips=$smtp\->recipient(@recipients, { Notify => [\*(AqFAILURE\*(Aq], SkipBad => 1 });  # Good\&  $smtp\->recipient("$recipient,$recipient2"); # BAD.Ve.SpNotify is used to request Delivery Status Notifications (DSNs), but your\&\s-1SMTP/ESMTP\s0 service may not respect this request depending upon its version andyour site's \s-1SMTP\s0 configuration..SpLeaving out the Notify option usually defaults an \s-1SMTP\s0 service to its defaultbehavior equivalent to ['\s-1FAILURE\s0'] notifications only, but again this may bedependent upon your site's \s-1SMTP\s0 configuration..SpThe \s-1NEVER\s0 keyword must appear by itself if used within the Notify option and \*(L"requeststhat a \s-1DSN\s0 not be returned to the sender under any conditions.\*(R".Sp.Vb 1\&  {Notify => [\*(AqNEVER\*(Aq]}\&\&  $smtp\->recipient(@recipients, { Notify => [\*(AqNEVER\*(Aq], SkipBad => 1 });  # Good.Ve.SpYou may use any combination of these three values '\s-1SUCCESS\s0','\s-1FAILURE\s0','\s-1DELAY\s0' inthe anonymous array reference as defined by \s-1RFC3461\s0 (see http://rfc.net/rfc3461.htmlfor more information.  Note: quotations in this topic from same.)..SpA Notify parameter of '\s-1SUCCESS\s0' or '\s-1FAILURE\s0' \*(L"requests that a \s-1DSN\s0 be issued onsuccessful delivery or delivery failure, respectively.\*(R".SpA Notify parameter of '\s-1DELAY\s0' \*(L"indicates the sender's willingness to receivedelayed DSNs.  Delayed DSNs may be issued if delivery of a message has beendelayed for an unusual amount of time (as determined by the Message TransferAgent (\s-1MTA\s0) at which the message is delayed), but the final delivery status(whether successful or failure) cannot be determined.  The absence of the \s-1DELAY\s0keyword in a \s-1NOTIFY\s0 parameter requests that a \*(R"delayed\*(L" \s-1DSN\s0 \s-1NOT\s0 be issued underany conditions.\*(R".Sp.Vb 1\&  {Notify => [\*(AqSUCCESS\*(Aq,\*(AqFAILURE\*(Aq,\*(AqDELAY\*(Aq]}\&\&  $smtp\->recipient(@recipients, { Notify => [\*(AqFAILURE\*(Aq,\*(AqDELAY\*(Aq], SkipBad => 1 });  # Good.Ve.SpORcpt is also part of the \s-1SMTP\s0 \s-1DSN\s0 extension according to \s-1RFC3461\s0.It is used to pass along the original recipient that the mail was firstsent to.  The machine that generates a \s-1DSN\s0 will use this address to informthe sender, because he can't know if recipients get rewritten by mail servers.It is expected to be in a format as required by \s-1RFC3461\s0, xtext-encoded..IP "to ( \s-1ADDRESS\s0 [, \s-1ADDRESS\s0 [...]] )" 4.IX Item "to ( ADDRESS [, ADDRESS [...]] )".PD 0.IP "cc ( \s-1ADDRESS\s0 [, \s-1ADDRESS\s0 [...]] )" 4.IX Item "cc ( ADDRESS [, ADDRESS [...]] )".IP "bcc ( \s-1ADDRESS\s0 [, \s-1ADDRESS\s0 [...]] )" 4.IX Item "bcc ( ADDRESS [, ADDRESS [...]] )".PDSynonyms for \f(CW\*(C`recipient\*(C'\fR..IP "data ( [ \s-1DATA\s0 ] )" 4.IX Item "data ( [ DATA ] )"Initiate the sending of the data from the current message..Sp\&\f(CW\*(C`DATA\*(C'\fR may be a reference to a list or a list. If specified the contentsof \f(CW\*(C`DATA\*(C'\fR and a termination string \f(CW".\er\en"\fR is sent to the server. And theresult will be true if the data was accepted..SpIf \f(CW\*(C`DATA\*(C'\fR is not specified then the result will indicate that the serverwishes the data to be sent. The data must then be sent using the \f(CW\*(C`datasend\*(C'\fRand \f(CW\*(C`dataend\*(C'\fR methods described in Net::Cmd..IP "expand ( \s-1ADDRESS\s0 )" 4.IX Item "expand ( ADDRESS )"Request the server to expand the given address Returns an arraywhich contains the text read from the server..IP "verify ( \s-1ADDRESS\s0 )" 4.IX Item "verify ( ADDRESS )"Verify that \f(CW\*(C`ADDRESS\*(C'\fR is a legitimate mailing address..SpMost sites usually disable this feature in their \s-1SMTP\s0 service configuration.Use \*(L"Debug => 1\*(R" option under \fInew()\fR to see if disabled..ie n .IP "help ( [ $subject ] )" 4.el .IP "help ( [ \f(CW$subject\fR ] )" 4.IX Item "help ( [ $subject ] )"Request help text from the server. Returns the text or undef upon failure.IP "quit ()" 4.IX Item "quit ()"Send the \s-1QUIT\s0 command to the remote \s-1SMTP\s0 server and close the socket connection..SH "ADDRESSES".IX Header "ADDRESSES"Net::SMTP attempts to \s-1DWIM\s0 with addresses that are passed. Forexample an application might extract The From: line from an emailand pass that to \fImail()\fR. While this may work, it is not recommended.The application should really use a module like Mail::Addressto extract the mail address and pass that..PPIf \f(CW\*(C`ExactAddresses\*(C'\fR is passed to the constructor, then addressesshould be a valid rfc2821\-quoted address, although Net::SMTP willaccept accept the address surrounded by angle brackets..PP.Vb 3\& funny user@domain      WRONG\& "funny user"@domain    RIGHT, recommended\& <"funny user"@domain>  OK.Ve.SH "SEE ALSO".IX Header "SEE ALSO"Net::Cmd.SH "AUTHOR".IX Header "AUTHOR"Graham Barr <gbarr@pobox.com>.SH "COPYRIGHT".IX Header "COPYRIGHT"Copyright (c) 1995\-2004 Graham Barr. All rights reserved.This program is free software; you can redistribute it and/or modifyit under the same terms as Perl itself.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -