Cloud Mail 2020 Node.js Edition

Questions / Feedback?

CreateDraft Method

Creates a new email draft.

Syntax

office365.createDraft(draftType, id, [callback])

Callback

The 'callback' parameter specifies a function which will be called when the operation completes (or an error is encountered). If the 'callback' parameter is not specified, then the method will block and will not return until the operation completes (or an error is encountered).

The callback for this method is defined as:

function(err){ }

'err' is the error that occurred. If there was no error, then 'err' is 'null'.

'err' has 2 properties which hold detailed information:

err.code
err.message

Remarks

This method creates a new draft in the Drafts folder. The created message's information is also added to the MessageInfo property.

Valid values for DraftType :

0DRAFTTYPE_MESSAGE
1DRAFTTYPE_REPLY
2DRAFTTYPE_REPLYALL
3DRAFTTYPE_FORWARD

When using DRAFTTYPE_REPLY, DRAFTTYPE_REPLYALL, or DRAFTTYPE_FORWARD the id parameter can be used to specify the message that is being replied to or forwarded. When using DRAFTTYPE_MESSAGE, pass in an empty string as the id.

Example


office365.MessageSubject = "I saw a Tree";
office365.MessageImportance = "High";
office365.MessageBodyContentType = "TEXT";
office365.MessageBodyContent = "It was in my back yard initially. It was still there when I last checked.";
office365.MessageTo = "TreeLookOut@gmail.com";

office365.CreateDraft(0, "");

 
 
Copyright (c) 2021 /n software inc. - All rights reserved.
Cloud Mail 2020 Node.js Edition - Version 20.0 [Build 7718]