none
[openafs-wiki.git] / TWiki / TWikiNetDotPm.mdwn
1 # <a name="Package &lt;code&gt;TWiki::Net="></a> Package =TWiki::Net
2
3 Object that brokers access to network resources.
4
5 <div>
6   <ul>
7     <li><a href="#Package =TWiki::Net="> Package TWiki::Net</a><ul>
8         <li><a href="#ObjectMethod <strong>getUrl</strong> ($protocol"> ObjectMethod getUrl <tt>($protocol,$host,$port,$url,$user,$pass) -&gt; $text</tt></a></li>
9         <li><a href="#set_MailHandler( \fn )"> setMailHandler( \&amp;fn )</a></li>
10         <li><a href="#ObjectMethod <strong>sendEmail</strong> ($text,"> ObjectMethod sendEmail <tt>($text,$retries) -&gt; $error</tt></a></li>
11       </ul>
12     </li>
13   </ul>
14 </div>
15
16 ## <a name="ObjectMethod &lt;strong&gt;getUrl&lt;/strong&gt; ($protocol"></a> [[ObjectMethod]] **getUrl** `($protocol,$host,$port,$url,$user,$pass) -> $text`
17
18 Get the text at the other end of a URL
19
20 ## <a name="set_MailHandler( \fn )"></a> setMailHandler( \\&amp;fn )
21
22 - `\&fn` - reference to a function($) (see \_sendEmailBySendmail for proto)
23
24 Install a handler function to take over mail sending from the default SMTP or sendmail methods. This is provided mainly for tests that need to be told when a mail is sent, without actually sending it. It may also be useful in the event that someone needs to plug in an alternative mail handling method.
25
26 ## <a name="ObjectMethod &lt;strong&gt;sendEmail&lt;/strong&gt; ($text,"></a> [[ObjectMethod]] **sendEmail** `($text,$retries) -> $error`
27
28 - `$text` - text of the mail, including MIME headers
29 - `$retries` - number of times to retry the send (default 1)
30
31 Send an email specified as MIME format content. Date: ...\\nFrom: ...\\nTo: ...\\nCC: ...\\nSubject: ...\\n\\nMailBody...