<?xml version="1.0" encoding="utf-8"?>
<KScriptSetting>
  <Name>mail</Name>
  <Description>Send an email. You may need credit to send internet emails on online version</Description>
  <Example>
    <![CDATA[
 <script engine="kscript"> 
    var msg = {}; 
    msg.to="test@koobootemp.com"; 
    msg.from= "yourname@yoursite.com"; 
    msg.subject = "this is a test email"; 
    msg.textBody = "this is the text body"; 
    msg.htmlBody = "<b>you may have additional html body";  
    k.mail.send(msg);  
</script>
	]]></Example>
  <Props />
  <Methods>
    <Method>
      <Name>send</Name>
      <Description>Send an email. You may need credit to send internet emails on online version</Description>
      <Example> 
        <![CDATA[
 <script engine="kscript"> 
    var msg = {}; 
    msg.to="test@koobootemp.com"; 
    msg.from= "yourname@yoursite.com"; 
    msg.subject = "this is a test email"; 
    msg.textBody = "this is the text body"; 
    msg.htmlBody = "<b>you may have additional html body";  
    k.mail.send(msg);  
</script>
	]]>
      </Example>
      <Params>
        <Param>
          <Name>Msg</Name>
          <Description>MailObj with properties of: to, from, subject, textBody and htmlBody</Description>
          <Type>MailObj</Type>
        </Param>
      </Params> 
    </Method>


    <Method>
      <Name>smtpSend</Name>
      <Description>Send an email using an external smtp server</Description>
      <Example>
        <![CDATA[
 <script engine="kscript"> 
      var msg = {}; 
      msg.to="guoqi@kooboo.net"; 
      msg.from= "1802897953@qq.com"; 
      msg.subject = "this is a test email xxxx";  
      msg.body = "some html body";  
     
     var smtpserver = {}; 
     smtpserver.host = "smtp.qq.com"; 
     smtpserver.port = 587; 
     smtpserver.ssl = true; 
     smtpserver.username = "1802897953@qq.com"; 
     smtpserver.password = "xjpctnbtvsxwbige"; 
     
     k.mail.smtpSend(smtpserver, msg);  
</script>
	]]>
      </Example>
      <Params>
        <Param>
          <Name>Server</Name>
          <Description>SmtpServer with properties of: host, username, password, ssl and port</Description>
          <Type>SmtpServer</Type>
        </Param>
        <Param>
          <Name>Msg</Name>
          <Description>MailObj with properties of: to, from, subject, textBody and htmlBody</Description>
          <Type>MailObj</Type>
        </Param>
      </Params>
    </Method>
  </Methods>
</KScriptSetting>