SendMail()

Schedules a mail item.

Token ID

AFTKN_SEND_MESSAGE or 578

Syntax

DWORD SendMail( ANSISTRING To; 
                [ANSISTRING Subject]; 
                [ANSISTRING Message]; 
                [ANSISTRING Attach]; 
                [ANSISTRING CC]; 
                [ANSISTRING BC]; 
                [ANSISTRING From]; 
                [ENUM IsRouted]; 
                [ANSISTRING ViewName]; 
                [ENUM AttachListHasDisplayNames]; 
                [ANSISTRING UserID]; 
                [ANSISTRING MessageIDs]; 
                [ENUM MessageIsFile]; 
                [ENUM SubjectIsFile]; 
                [ENUM ViewNameIsFile]; 
                [ENUM AttachmentsArePersonal]; 
                [ANSISTRING OleAttach]; 
                [ANSISTRING SenderID])

Parameters

To As ANSISTRING

User ID of one or more appointment recipients. Separate multiple recipients with commas.

Subject As ANSISTRING

Parameter also accepts a file name. (Optional)

Message As ANSISTRING

Parameter also accepts a file name. (Optional)

Attach As ANSISTRING

Separate multiple attachments with commas. (Optional)

CC As ANSISTRING

User ID of one or more carbon copy recipients. Separate multiple recipients with commas. (Optional)

BC As ANSISTRING

User ID of one or more blind copy recipients. Separate multiple recipients with commas. (Optional)

From As ANSISTRING

Name of person scheduling the appointment. (Optional)

IsRouted As ENUM

Route mail item to two or more users in turn. (Optional)

  • 0 No
  • 1 Yes
ViewName As ANSISTRING

Name of a Mail view. For example, "Expanded Mail", or the name of a custom view. Parameter also accepts a file name. (Optional)

AttachListHasDisplayNames As ENUM

(Optional)

  • 0 No
  • 1 Yes and the Attach parameter must include the file name and display name for each attachment, respectively.
UserID As ANSISTRING

Use this parameter to schedule an appointment from a proxy mailbox. (Optional)

MessageIDs As ANSISTRING

Attach encapsulated items. Separate multiple message IDs with a comma. (Optional)

MessageIsFile As ENUM

Message parameter contains a file name. (Optional)

  • 0 No
  • 1 Yes
SubjectIsFile As ENUM

Subject parameter contains a file name. (Optional)

  • 0 No
  • 1 Yes
ViewNameIsFile As ENUM

ViewName parameter contains a file name. (Optional)

  • 0 No
  • 1 Yes
AttachmentsArePersonal As ENUM

(Optional)

  • 0 No
  • 1 Yes
OleAttach As ANSISTRING

(Optional)

SenderID As ANSISTRING

(Optional)

Return Values

  • IDforEnvSentMessageID DWORD. Staged message ID for tracking a mail item. Use EnvSentMessageID() token to get actual message ID of the mail item.

Remarks

The message body field (in the Message View and the Object API) has a limit of 32,000 characters. The Message View will stop accepting data after 32,000 characters.