Search these areas:
Support Forums
Product Info

DataWeb: What's New
Creating an Application
The DataWeb Designer
Application Management
Data Tables
Data Tables
Data Analysis
Object Model
JavaScript Objects
General Scripting Objects
-Classes Object
-Email Object
-Request Object
-Response Object
-Script Object
Data Access Objects
File Access Objects
Http Client Objects
Security and Membership Objects
Document Object Model (DOM)
Error Descriptions
Object Model Extensions
Full-Text Search
Domain and Email Hosting
HotBlock Modules
Account Management
New Responsive UI Module

DataWeb Help
Support Forums
Script Library
Knowledge Base

Home > Support

DataWeb User's Guide

Email Object
The Email object sends an email message from within a script. You can send email by calling the send() method directly on the Email prototype object and passing in all arguments, or creating an instance of an Email object, setting its properties individually, and then calling the send() method.

Alternatively, you can use the <ws:email> element to send email from script. Within the opening and closing <ws:email> tags, you can specify the fields to construct an Email object using a single text string. See Sending Email from Script in the "DataWeb Script Language Enhancements" discussion for more details about sending email with <ws:email> tags. Which syntax you use is a matter of personal preference, however.


[new] Email(to, from, replyTo, cc, bcc, subject, body[, contentType]) Returns a newly constructed Email object instance. The arguments specify the properties of the Email object instance.

Instance Properties

to Specifies the recipient(s) of the email message.
from Specifies the sender of the email message. DataWeb Internet headers are attached to sent messages.
replyTo Specifies the reply-to address for the email message. If left blank, the value of the from property will be used as a reply-to address.
cc Specifies the carbon-copy recipients of the email message.
bcc Specifies the blind carbon-copy recipients of the email message.
subject Specifies the subject of the email message.
body Specifies the body of the email message.
contentType Specifies the content type for the email message. If left undefined, contentType will be set to "text/plain." The other common value is "text/html."

Instance Method

send Sends an email message. When send is called on an instance of the prototype Email object, the properties of the instance object must be defined explicitly.

Prototype Method

send Sends an email message.

The first example below demonstrates calling the send() method of the prototype object. The second example creates a new Email object instance, defines its properties, and then sends it:
     //Example #1: Using the Prototype Email object
   Email.send("", "", 
      "", "", "",
      "Mary Smith sick today", 
      "I am sick today and I will not be coming into work.  - Mary", 

     //Example #2: Using an instance of the Email object
   var mmMessage = new Email(); = "";
   mmMessage.from = "";
   mmMessage.replyTo = ""; = "";
   mmMessage.bcc = "";
   mmMessage.subject = "Mary Smith sick today";
   mmMessage.body = "I am sick today 
            and I will not be coming into work.  -Mary";
   mmMessage.contentType = "text/html";
Affiliate | Partner | Terms of Use | Privacy Policy | Contact Us | Pricing | Bring DataWeb In-House    
Email Us