SetBody (Email subroutine): Difference between revisions
Jump to navigation
Jump to search
m (1 revision) |
mNo edit summary |
||
Line 1: | Line 1: | ||
{{Template:Email:SetBody subtitle}} | {{Template:Email:SetBody subtitle}} | ||
==Syntax== | ==Syntax== | ||
{{Template:Email:SetBody syntax}} | {{Template:Email:SetBody syntax}} | ||
Line 37: | Line 36: | ||
the <var>Encoding</var> option set to the value <code>none</code>. | the <var>Encoding</var> option set to the value <code>none</code>. | ||
<dt><b>Encoding</b> | <dt><b>Encoding</b> | ||
<dd>This | <dd>This name required parameter | ||
forces or suppresses encoding for the attachment. | forces or suppresses encoding for the attachment. | ||
Since base64 encoding is automatically enabled for any non-text content, | Since base64 encoding is automatically enabled for any non-text content, | ||
Line 57: | Line 56: | ||
==Usage notes== | ==Usage notes== | ||
Subsequent invocations of the <var>SetBody</var> method completely replace any | Subsequent invocations of the <var>SetBody</var> method completely replace any | ||
existing content. | existing content. | ||
==Examples== | ==Examples== | ||
<ul> | <ul> | ||
<li>The following code fragment adds HTML text to the to the body of an | <li>The following code fragment adds HTML text to the to the body of an | ||
SMTP message: | SMTP message: | ||
<p class="code"> | <p class="code"> ... | ||
%greet is object Email | |||
%sl is object Stringlist | |||
html to %sl | |||
<html> | |||
<nowiki><h1> | |||
Hello world! | |||
</h1></nowiki> | |||
</html> | |||
end html | |||
%greet:SetBody(%sl, type='text/html') | |||
... | |||
</p> | </p> | ||
<li>For <var>SetBody</var> method examples, see [[SMTP Helper#Basic e-mail|"Basic e-mail"]] and | <li>For <var>SetBody</var> method examples, see [[SMTP Helper#Basic e-mail|"Basic e-mail"]] and |
Revision as of 19:53, 6 July 2011
Add body content to the message (Email class)
Syntax
email:SetBody( content, [Type= string], [Name= string], [Encoding= string])
Syntax terms
A previously declared Email object. | |
content | A Stringlist or Longstring that contains the actual e-mail body.
If a Stringlist is passed, each item in the Stringlist is delimited with a carriage-return/line-feed (CR/LF) character pair. To override this line-ending, you can specify a non-text content type as the value of the Type optional argument. In this case, no delimiter is added at the end of an item. If a longstring is passed, no delimiters are added to the content. |
options | Any combination of the following options. Each may be specified only once.
|
Usage notes
Subsequent invocations of the SetBody method completely replace any existing content.
Examples
- The following code fragment adds HTML text to the to the body of an
SMTP message:
... %greet is object Email %sl is object Stringlist html to %sl <html> <h1> Hello world! </h1> </html> end html %greet:SetBody(%sl, type='text/html') ...
- For SetBody method examples, see "Basic e-mail" and "E-mail with attachment".