<< Click to Display Table of Contents >>

SetFrom

Sets the sender's mail address.

Prototype

void SetFrom(string MailAddress, [string UserName])

Parameters

MailAddress

sender's mail address

UserName

sender's name

Example

function mailTest() {

   try {

       var mail = OZCreator.GetBuiltInObject(OZBuiltInObject.MAIL);

       mail.SetSmtpServer("mail.forcs.com");

       mail.SetSmtpPort(25);

       mail.SetSmtpID("oz@forcs.com");

       mail.SetSmtpPW("UserPassword");

       mail.SetFrom("oz@forcs.com","Forcs");

       mail.SendRetryCount(1);

       mail.SendRetryPeriodTime(10);

       mail.PrefixSubjectMessage("[Forcs]");

       mail.SetRecipients(RecipientTypeConst.TO, "user1@forcs.com, user2@forcs.com");

       mail.SetRecipients(RecipientTypeConst.BCC, "user3@forcs.com");

       mail.SetSubject("Mail Subject");

       mail.SetContext("Mail Context");

       mail.AddAttachmentPart("d:/sample.xls");

       mail.Send();

   } catch(e) {

       _ERROR(e);

   }

}