J-ASP NewMail
J-ASP NewMail object provides for sending a
message with very few lines of code. It is compatible with CDONTS NewMail object.
Requirements:
NewMail is based on Sun's Java Mail API, please set Sun's mail.jar and activation.jar to the classpath.
Simple NewMail Example
- Creating the object
- Setting a few properties
- Calling the Send method
The following codes demonstrate how to use J-ASP
NewMail in VBScript.
Set myMail = CreateObject("CDONTS.NewMail")
myMail.From = "Example@Microsoft.com"
myMail.To = "Someone@company.com"
myMail.Subject = "Sample Message"
myMail.Body = "This is a sample message."
myMail.UserName = "smtp user "
myMail.Password = "smtp password"
myMail.RemoteHost = "smtp host"
myMail.Send
Set myMail = Nothing
|
J-ASP will convert above ASP code into following JSP Code:
jasp.smtp.NewMail mymail = null;
mymail = new jasp.smtp.NewMail();
mymail.setFrom("Example@Microsoft.com");
mymail.setTo("Someone@company.com");
mymail.setSubject("Sample Message");
mymail.setBody("This is a sample message.");
mymail.setUserName("smtp user ");
mymail.setPassword("smtp password");
mymail.setRemoteHost("smtp host");
mymail.Send();
mymail = null;
|
J-ASP NewMail Properties Supported
Property |
Supported |
Bcc |
Yes |
Body |
Yes |
BordyFormat |
Yes |
CC |
Yes |
ContentBase |
Yes |
ContentLocation |
Yes |
From |
Yes |
Importance |
Yes |
MailFormat |
Yes |
Subject |
Yes |
To |
Yes |
Value |
Yes |
Version |
Yes (return "1.2") |
UserName |
The User Name of SMTP
Authenticator |
Password |
The password of SMTP user |
RemoteHost |
SMTP host , the default host is localhost. |
J-ASP Mail Methods Supported
Method |
Supported |
AttachFile |
Yes |
AttachURL |
Yes |
Send |
Yes |
SetLocalIDS |
No |