Mail (Email function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (Created page with "==Mail (Email function)== This callable method sends the mail message to an SMTP server. ==Mail syntax== <p class="pre"> [%rc =] %email:Mail([clientport], [cancel]) </p> ===Syn...")
 
m (Created page with "==Mail (Email function)== This callable method sends the mail message to an SMTP server. ==Mail syntax== <p class="pre"> [%rc =] %email:Mail([clientport], [cancel]) </p> ===Syn...")
Line 1: Line 1:
==Mail (Email function)==
==Mail (Email function)==
This callable method sends the mail message to an SMTP server.
This callable method sends the mail message to an SMTP server.
==Mail syntax==
==Syntax==
<p class="pre"> [%rc =] %email:Mail([clientport], [cancel])
{{Template:Email:Mail syntax}}
</p>
===Syntax terms===
===Syntax terms===
<table class="syntaxTable">
<table class="syntaxTable">
Line 37: Line 35:
</td></tr></table>
</td></tr></table>
   
   
==Usage Notes==
==Usage notes==
<ul>
<ul>
<li>The SMTP Helper adds a &ldquo;Date:&rdquo; header to an Email object instance by default
<li>The SMTP Helper adds a &amp;ldquo;Date:&amp;rdquo; header to an Email object instance by default
if you do not explicitly add one with AddHeader.
if you do not explicitly add one with AddHeader.
If a Date header is present at the time the mail method is invoked,
If a Date header is present at the time the mail method is invoked,
Line 48: Line 46:
[[SMTP Helper#E-mail with attachment|"E-mail with attachment"]].
[[SMTP Helper#E-mail with attachment|"E-mail with attachment"]].
</ul>
</ul>
==See also==
{{Template:Email:Mail footer}}

Revision as of 21:41, 5 July 2011

Mail (Email function)

This callable method sends the mail message to an SMTP server.

Syntax

[%rc =] email:Mail[( [[Port=] string], [[CancelOnError=] number], - [Userid= string], [Password= string])]

Syntax terms

%rc If specified, a numeric variable to contain the return code.

A value of 0 indicates success; a value of 1 indicates a communication error. If some other unexpected content is present or event occurs, %rc will contain the return code sent from the SMTP server. These codes are listed in "SMTP server codes".

%email A previously declared Email object.
clientport An optional string expression that identifies a previously

defined Janus CLSOCK port. The clientport default is the MASTER port, if any is defined. However, if you omit clientport and no MASTER port is defined, the request is cancelled (subject to the cancel setting).

cancel An optional numeric expression that controls whether the request is

cancelled if a communication/socket error occurs:

  • If zero, the request is not cancelled on these errors.
  • If non-zero, the request is cancelled (though a message is still issued).
  • If not specified, the default is to cancel the request.

Usage notes

  • The SMTP Helper adds a &ldquo;Date:&rdquo; header to an Email object instance by default if you do not explicitly add one with AddHeader. If a Date header is present at the time the mail method is invoked, it is left intact. The Date header generated by the SMTP Helper uses the system clock (usually GMT), adjusted by the GMT offset specified in the OS system parameters.
  • For Mail method examples, see "Basic e-mail" and "E-mail with attachment".

See also