1 # <a name="Package <code>TWiki::Net="></a> Package =TWiki::Net
3 Object that brokers access to network resources.
7 <li><a href="#Package =TWiki::Net="> Package TWiki::Net</a><ul>
8 <li><a href="#ObjectMethod <strong>getUrl</strong> ($host,$po"> ObjectMethod getUrl <tt>($host,$port,$url,$user,$pass,$header) -> $text</tt></a></li>
9 <li><a href="#set_MailHandler( \fn )"> setMailHandler( \&fn )</a></li>
10 <li><a href="#ObjectMethod <strong>sendEmail</strong> ($text,"> ObjectMethod sendEmail <tt>($text,$retries) -> $error</tt></a></li>
16 ## <a name="ObjectMethod <strong>getUrl</strong> ($host,$po"></a> [[ObjectMethod]] **getUrl** `($host,$port,$url,$user,$pass,$header) -> $text`
18 Get the text at the other end of a URL
20 ## <a name="set_MailHandler( \fn )"></a> setMailHandler( \\&fn )
22 - `\&fn` - reference to a function($) (see \_sendEmailBySendmail for proto)
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.
26 ## <a name="ObjectMethod <strong>sendEmail</strong> ($text,"></a> [[ObjectMethod]] **sendEmail** `($text,$retries) -> $error`
28 - `$text` - text of the mail, including MIME headers
29 - `$retries` - number of times to retry the send (default 1)
31 Send an email specified as MIME format content. Date: ...\\nFrom: ...\\nTo: ...\\nCC: ...\\nSubject: ...\\n\\nMailBody...