Detailed reference of prototypes, properties and methods available in the
Javascript environment of your Helma web applications.

Fields and methods of the helma.Mail class.
To use this optional module, its repository needs to be added to the application, for example by calling app.addRepository('modules/helma/Mail.js')
helma Mail(smtp)
Mail client enabling you to send e-mail via SMTP using Packages.javax.mail.
parameters

String | smtp | as String, the hostname of the mail server

methods

- setAuthentication(uname, pwd)

- getMessage()

- setDebug(debug)

- setFrom(addstr, name)

- setReplyTo(addstr)

- setTo(addstr, name)

- addTo(addstr, name)

- addCC(addstr, name)

- addBCC(addstr, name)

- setSubject(subject)

- setText(text)

- addText(text)

- setMultipartType(messageType)

- getMultipartType(messageType)

- addPart(obj, filename, contentType)

- writeToFile(dir)

- getSource()

- send()

properties

- status

helma.Mail. status
The status of this Mail object. This equals `0` unless an error occurred. See {@link helma.Mail Mail.js} source code for a list of possible error codes.
Methods
helma.Mail. setAuthentication(uname, pwd)
Sets username and password to use for SMTP authentication.
parameters

String | uname | The username to use
String | pwd | The password to use

helma.Mail. getMessage()
Returns the wrapped message
returns

| The wrapped message

helma.Mail. setDebug(debug)
Switches debug mode on or off.
parameters

Boolean | debug | If true debug mode is enabled

helma.Mail. setFrom(addstr, name)
Sets the sender of an e-mail message.
The first argument specifies the receipient's e-mail address. The optional second argument specifies the name of the recipient.
parameters

String | addstr | as String, sender email address
String | name | as String, optional sender name

helma.Mail. setReplyTo(addstr)
Sets the Reply-To address of an e-mail message.
parameters

String | addstr | as String, the reply-to email address

helma.Mail. setTo(addstr, name)
Sets the recipient of an e-mail message. The first argument specifies the receipient's e-mail address. The optional second argument specifies the name of the recipient.
parameters

String | addstr | as String, receipients email address
String | name | as String, optional receipients name

see

helma.Mail.addTo

helma.Mail. addTo(addstr, name)
Adds a recipient to the address list of an e-mail message.
The first argument specifies the receipient's e-mail address. The optional second argument specifies the name of the recipient.
parameters

String | addstr | as String, receipients email address
String | name | as String, optional receipients name

see

setTo

helma.Mail. addCC(addstr, name)
Adds a recipient to the list of addresses to get a "carbon copy" of an e-mail message.
The first argument specifies the receipient's e-mail address. The optional second argument specifies the name of the recipient.
parameters

String | addstr | as String, receipients email address
String | name | as String, optional receipients name

helma.Mail. addBCC(addstr, name)
Adds a recipient to the list of addresses to get a "blind carbon copy" of an e-mail message.
The first argument specifies the receipient's e-mail address. The optional second argument specifies the name of the recipient.
parameters

String | addstr | as String, receipients email address
String | name | as String, optional receipients name

helma.Mail. setSubject(subject)
Sets the subject of an e-mail message.
parameters

String | subject | as String, the email subject

helma.Mail. setText(text)
Sets the body text of an e-mail message.
parameters

String | text | as String, to be appended to the message body

see

helma.Mail.addText

helma.Mail. addText(text)
Appends a string to the body text of an e-mail message.
parameters

String | text | as String, to be appended to the message body

see

helma.Mail.setText

helma.Mail. setMultipartType(messageType)
Sets the MIME multiparte message subtype. The default value is "mixed" for messages of type multipart/mixed. A common value is "alternative" for the multipart/alternative MIME type.
parameters

String | messageType | the MIME subtype such as "mixed" or "alternative".

see

helma.Mail.getMultipartType
helma.Mail.addPart

helma.Mail. getMultipartType(messageType)
Returns the MIME multiparte message subtype. The default value is "mixed" for messages of type multipart/mixed.
parameters

| messageType |

returns

| the MIME subtype

see

helma.Mail.setMultipartType
helma.Mail.addPart

helma.Mail. addPart(obj, filename, contentType)
Adds an attachment to an e-mail message.
The attachment needs to be either a helma.util.MimePart Object retrieved through the global getURL function, or a {@link helma.File} object, or a String.
Use the getURL() function to retrieve a MIME object or wrap a helma.File object around a file of the local file system.
parameters

fileOrMimeObjectOrString | obj | File, Mime object or String to attach to the email
String | filename | optional name of the attachment
String | contentType | optional content type (only if first argument is a string)

see

global.getURL
helma.util.MimePart
helma.File

helma.Mail. writeToFile(dir)
Saves this mail RFC 822 formatted into a file. The name of the file is prefixed with "helma.Mail" followed by the current time in milliseconds and a random number.
parameters

helma.File | dir | An optional directory where to save this mail to. If omitted the mail will be saved in the system's temp directory.

helma.Mail. getSource()
Returns the source of this mail as RFC 822 formatted string.
returns

| The source of this mail as RFC 822 formatted string

helma.Mail. send()
Sends an e-mail message.
This function sends the message using the SMTP server as specified when the Mail object was constructed using helma.Mail.
If no smtp hostname was specified when the Mail object was constructed, the smtp property in either the app.properties or server.properties file needs to be set in order for this to work.
As a fallback, the message will then be written to file using the {@link #writeToFile} method. Additionally, the location of the message files can be determined by setting smtp.dir in app.properties to the desired file path.
Tue, 25 Nov 2008 16:50:19 GMT.

### core framework

- global
- app (application)
- req (request)
- res (response)
- session
- path
- root
- HopObject
- User
- File
- FtpClient
- Image
- Mail
- Remote
- Xml
- DatabaseObject
- MimePart
- Skin
- Object

### optional modules

- Array extensions
- Date extensions
- Number extensions
- Object extensions
- String extensions
- HopObject extensions
- global macros
- macro filters
- JSON methods
- helma.Aspects
- helma.Chart
- helma.Color
- helma.Database
- helma.File
- helma.Ftp
- helma.Group
- helma.Html
- helma.Http
- helma.Image
- helma.Mail
- helma.Search
- helma.Skin
- helma.Ssh
- helma.Url
- helma.Zip
- jala.BitTorrent
- jala.Captcha
- jala.Date
- jala.db
- jala.DnsClient
- jala.Form
- jala.History
- jala HopObject extensions
- jala.HtmlDocument
- jala.I18n
- jala.ImageFilter
- jala.IndexManager
- jala.ListRenderer
- jala.Mp3
- jala.PodcastWriter
- jala.RemoteContent
- jala.Rss20Writer
- jala.Utilities
- jala.XmlRpcRequest
- jala.XmlWriter

### java libraries

- browse docjar