Server-side object | |
Implemented in | Netscape Server 3.0 |
The To
and From
attributes are required. All other properties are optional.
SendMail
constructor:new SendMail();
SendMail
object are sent in the header of the mail message.
The SendMail
object allows you to send either simple text-only mail messages or complex MIME-compliant mail or add attachments to your message. To send a MIME message, set the Content-Type
property to the MIME type of the message.
<server>Example 2: The following example sends an image in a GIF file:
SMName = new SendMail();
SMName.To = "vpg@co1.com, gwp@co2.com"
SMName.From = "me@myco.com"
SMName.Cc = "jaym@hisco.com"
SMName.Subject = "The State of the Universe"
SMName.Body = "The universe, contrary to what you may have heard, is in none too shabby shape. Not to worry! --me"
SMName.send()
</server>
sm = new SendMail();Example 3: The following example sends a multipart message:
sm.To = "satish";
sm.From = "satish@netscape.com";
sm.Smtpserver = "fen.mcom.com";
sm["Errors-to"] = "satish";
sm["Content-type"] = "image/gif";
sm["Content-Transfer-Encoding"] = "base64";
file = new File("/u/satish/LiveWire/mail/banner.gif");
openFlag = file.open("r");
if ( openFlag ) {
len = file.getLength();
str = file.read(len);
sm.Body = str;
}
sm.send();
sm = new SendMail();The file
sm.To = "chandra@cs.uiowa.edu, satish@netscape.com";
sm.From = "satish@netscape.com";
sm.Smtpserver = "fen.mcom.com";
sm.Organization = "Netscape Comm Corp";
sm["Content-type"] = "multipart/mixed; boundary=\"------------8B3F7BA67B67C1DDE6C25D04\"";
file = new File("/u/satish/LiveWire/mail/mime");
openFlag = file.open("r");
if ( openFlag ) {
len = file.getLength();
str = file.read(len);
sm.Body = str;
}
sm.send();
mime
has HTML text and an Microsoft Word document separated by the specified boundary. The resulting message appears as HTML text followed by the Microsoft Word attachment.
Property of |
SendMail
|
Implemented in | Netscape Server 3.0 |
Property of |
SendMail
|
Implemented in | Netscape Server 3.0 |
Property of |
SendMail
|
Implemented in | Netscape Server 3.0 |
Property of |
SendMail
|
Implemented in | Netscape Server 3.0 |
Property of |
SendMail
|
Implemented in | Netscape Server 3.0 |
Property of |
SendMail
|
Implemented in | Netscape Server 3.0 |
Function.prototype
.
Property of |
SendMail
|
Implemented in | LiveWire 1.0 |
Property of |
SendMail
|
Implemented in | Netscape Server 3.0 |
Property of |
SendMail
|
Implemented in | Netscape Server 3.0 |
Property of |
SendMail
|
Implemented in | Netscape Server 3.0 |
Property of |
SendMail
|
Implemented in | Netscape Server 3.0 |
Method of |
SendMail
|
Implemented in | Netscape Server 3.0 |
public errorCode();
Method of |
SendMail
|
Implemented in | Netscape Server 3.0 |
public errorMessage();
Method of |
SendMail
|
Implemented in | Netscape Server 3.0 |
public send ();
errorMessage
and errorCode
methods to determine the nature of the error.This method returns a string indicating the nature of the error that occurred sending the message.
Last Updated: 10/31/97 16:37:22