# NewMail

#### Description

New mail function is used to send regular e-mail from Atollon. I supports sending both plaintext and html e-mails. In case html e-mail is sent, plaintext part is generated automatically.

#### Fields Description

<table border="1" id="bkmrk-field-description-ex" style="border-collapse: collapse; width: 100%;"><tbody><tr><td style="width: 33.333333333333336%;">**Field**</td><td style="width: 33.333333333333336%;">**Description**</td><td style="width: 33.333333333333336%;">**Example**</td></tr><tr><td style="width: 33.333333333333336%;">priority</td><td style="width: 33.333333333333336%;">E-mail priority handled by other mail clients</td><td style="width: 33.333333333333336%;">1, 2, 3</td></tr><tr><td style="width: 33.333333333333336%;">group</td><td style="width: 33.333333333333336%;">Message group with similar characteristics, required</td><td style="width: 33.333333333333336%;">For e-mails sent in context, there is always default "group" available in the response of request to getFolder, getProject, getActivity. For example:

&lt;messageGroup&gt;133185101&lt;/messageGroup&gt;

</td></tr><tr><td style="width: 33.333333333333336%;">treeHandle</td><td style="width: 33.333333333333336%;">Message container (mailbox)</td><td style="width: 33.333333333333336%;">Similar comment to "group" field above:

&lt;messageDefault&gt;133186101&lt;/messageDefault&gt;

</td></tr><tr><td style="width: 33.333333333333336%;">html</td><td style="width: 33.333333333333336%;">What is the body format?</td><td style="width: 33.333333333333336%;">0..plaintext

1..html

</td></tr><tr><td style="width: 33.333333333333336%;">encoding</td><td style="width: 33.333333333333336%;">Use utf-8 only</td><td style="width: 33.333333333333336%;">utf-8

</td></tr><tr><td style="width: 33.333333333333336%;">from</td><td style="width: 33.333333333333336%;">Full format of sender mailbox</td><td style="width: 33.333333333333336%;"></td></tr><tr><td style="width: 33.333333333333336%;">to</td><td style="width: 33.333333333333336%;">Recipient address</td><td style="width: 33.333333333333336%;"></td></tr><tr><td style="width: 33.333333333333336%;">subject</td><td style="width: 33.333333333333336%;">Subject of the message</td><td style="width: 33.333333333333336%;"></td></tr><tr><td style="width: 33.333333333333336%;">body</td><td style="width: 33.333333333333336%;">Either plaintext or html part of the message (based on above html = 0/1 flag)</td><td style="width: 33.333333333333336%;"></td></tr><tr><td style="width: 33.333333333333336%;">attachments.attachment</td><td style="width: 33.333333333333336%;">Link to documentId in Atollon. The document will be converted to base64 and added to sent e-mail</td><td style="width: 33.333333333333336%;"></td></tr><tr><td style="width: 33.333333333333336%;">forwardEmails</td><td style="width: 33.333333333333336%;">List ids of e-mail messages that will be attached</td><td style="width: 33.333333333333336%;"></td></tr></tbody></table>

#### Example

```XML
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsdl="http://atollon.com/enterprise/wsdl">
   <soapenv:Header/>
   <soapenv:Body>
      <wsdl:NewMail>
         <server>acme</server>
         <session>5B5EA....8BD04</session>
      <mail>
        <priority>2</priority>
        <group>491826101</group>
        <treeHandle>491827101</treeHandle>
        <html>1</html>
        <encoding>utf-8</encoding>
        <from>"Your team" &lt;admin@mydomain.com&gt;</from>
        <to>jan@safka.cz</to>
        <subject>Welcome to your new world of success</subject>
        <body>&lt;html&gt;&lt;head&gt;&lt;title&gt;Welcome to your new world of success&lt;/title&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt; &lt;style type="text/css"&gt; &lt;!-- body,td,th { font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #333333; } a:link { color: #666666; } a:visited { color: #999999; } --&gt; &lt;/style&gt;&lt;/head&gt;&lt;body&gt;&lt;div ALIGN="LEFT"&gt;&lt;span style="font-family:helvetica,arial,sans-serif; font-size:12px; color:#000000; "&gt;This is the secret message&lt;/span&gt;&lt;/div&gt;

&lt;br/&gt;

&lt;div ALIGN="LEFT"&gt;&lt;span style="font-family:helvetica,arial,sans-serif; font-size:12px; color:#000000; "&gt;Your super powerful team&lt;/span&gt;&lt;/div&gt;

&lt;/body&gt;&lt;/html&gt;</body>
        <attachments>
          <attachment>
            <documentId>496477101</documentId>
          </attachment>
        </attachments>
        <forwardEmails/>
      </mail>
      </wsdl:NewMail>
   </soapenv:Body>
</soapenv:Envelope>
```

##### Response

```XML
<ns0:Envelope xmlns:ns0="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://atollon.com/enterprise/wsdl">
   <ns0:Body>
      <ns1:NewMailResponse>
         <result>OK</result>
         <time>0.07684398</time>
         <newId>496505101</newId>
         <newAcl>MSGS000000151828</newAcl>
         <needApproval>0</needApproval>
      </ns1:NewMailResponse>
   </ns0:Body>
</ns0:Envelope>
```

</body></html>