Host (Email property): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (Created page with "This method retrieves or sets the host name of the SMTP server host. ==Host syntax== <p class="pre"> %email:Host = hostname %curr = %email:Host </p> ===Syntax terms=== <tabl...")
 
mNo edit summary
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Template:Email:Host subtitle}}
This method retrieves or sets the host name of the SMTP server host.
This method retrieves or sets the host name of the SMTP server host.
==Host syntax==
 
<p class="pre"> %email:Host = hostname
==Syntax==
{{Template:Email:Host syntax}}
%curr = %email:Host
 
</p>
===Syntax terms===
===Syntax terms===
<table class="syntaxTable">
<table class="syntaxTable">
<tr><th>%email</th>
<tr><th>%currentString</th>
<td>A previously declared Email object.
<td>A string or longstring variable to contain the current value of the <var>Host</var> property. </td></tr>
</td></tr>
<tr><th>email</th>
<tr><th>hostname</th>
<td>An <var>Email</var> object. </td></tr>
<td>The host name or dotted IP address of the SMTP server host.
<tr><th>newString</th>
</td></tr>
<td>The host name or dotted IP address of the SMTP server host. </td></tr>
<tr><th>%curr</th>
</table>
<td>A string or longstring variable to contain the current value of the
 
Host property.
==Usage notes==
</td></tr></table>
==Usage Notes==
<ul>
<ul>
<li>The initial value of this property is a null string.
<li>The initial value of this property is a null string.
This means that <var>[[Mail (Email function)|Mail]]</var> method
This means that <var>[[Mail (Email function)|Mail]]</var> method
invocations will try to use the
invocations will try to use the
REMOTE host name (if present) from the Janus client socket port definition.
<var>[[REMOTE]]</var> host name (if present) from the Janus client socket port definition.
If the Janus client port does not have a REMOTE
If the Janus client port does not have a <var>REMOTE</var>
definition that specifies a TCP host name, you ''must''
definition that specifies a TCP host name, you ''must''
set this Host property to the correct value for the target SMTP server host.
set this <var>Host</var> property to the correct value for the target SMTP server host.
<li>If you set the Host property value, and the Janus client socket port
 
you are using has a host value defined, your Host property value must
<li>If you set the <var>Host</var> property value, and the Janus client socket port
you are using has a <var>REMOTE</var> host value defined, your <var>Host</var> property value must
match the host value on the client port.
match the host value on the client port.
</ul>
</ul>
==Mail (Email function)==
 
This callable method sends the mail message to an SMTP server.
==See also==
==Mail syntax==
{{Template:Email:Host footer}}
<p class="pre"> [%rc =] %email:Mail([clientport], [cancel])
</p>
===Syntax terms===
<table class="syntaxTable">
<tr><th>%rc</th>
<td>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|"SMTP server codes"]].
</td></tr>
<tr><th>%email</th>
<td>A previously declared Email object.
</td></tr>
<tr><th>clientport</th>
<td>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).
</td></tr>
<tr><th>cancel</th>
<td>An optional numeric expression that controls whether the request is
cancelled if a communication/socket error occurs:
<ul>
<li>If zero, the request is ''not'' cancelled on these errors.
<li>If non-zero, the request is cancelled (though a message is
still issued).
<li>If not specified, the default is to cancel the request.
</ul>
</td></tr></table>
==Usage Notes==
<ul>
<li>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.
<li>For <var>Mail</var> method examples, see [[SMTP Helper#Basic e-mail|"Basic e-mail"]] and
[[SMTP Helper#E-mail with attachment|"E-mail with attachment"]].
</ul>

Latest revision as of 16:17, 22 June 2012

The host name of the SMTP server (Email class)


This method retrieves or sets the host name of the SMTP server host.

Syntax

%currentString = email:Host email:Host = newString

Syntax terms

%currentString A string or longstring variable to contain the current value of the Host property.
email An Email object.
newString The host name or dotted IP address of the SMTP server host.

Usage notes

  • The initial value of this property is a null string. This means that Mail method invocations will try to use the REMOTE host name (if present) from the Janus client socket port definition. If the Janus client port does not have a REMOTE definition that specifies a TCP host name, you must set this Host property to the correct value for the target SMTP server host.
  • If you set the Host property value, and the Janus client socket port you are using has a REMOTE host value defined, your Host property value must match the host value on the client port.

See also