Topic Path: Symbol Reference > Classes > TIdIMAP4 Class > TIdIMAP4 Methods > AppendMsgNoEncodeFromFile Method
ContentsIndexHome
PreviousUpNext
TIdIMAP4.AppendMsgNoEncodeFromFile Method

Adds a message to the specified mailbox without encoding message parts.

function AppendMsgNoEncodeFromFile(
    const AMBName: String; 
    ASourceFile: string; 
    const AFlags: TIdMessageFlagsSet = []
): Boolean;
Parameters 
Description 
AMBName 
Mailbox name used to store the new message.
 
ASourceFile 
File with the message content to be added to the mailbox.
 
AFlags 
Message flags to apply to the message in the mailbox. Default value is []. 

Boolean - True on success.

AppendMsgNoEncodeFromFile is a Boolean function used to append a message stored in a file into the specified IMAP4 server mailbox. AppendMsgNoEncodeFromFile is very similar to the AppendMsg method, but does not perform encoding for message parts loaded from the specified file name. 

AppendMsgNoEncodeFromFile requires that the ConnectionState property contain the value csAuthenticated or csSelected, or an EIdConnectionStateError exception will be raised. 

AMBName is the mailbox name on the IMAP4 server to receive the message content. AMBName must contain a valid mailbox name on the IMAP4 server or an EIdConnectionStateError exception will be raised. 

ASourceFile is the file name containing the message content to be appended to the specified mailbox. ASourceFile contains values as created using the TIdMessage.SaveToFile method. 

AFlags indicates the set of message flags which should be applied to the message in the mailbox. AppendMsgNoEncodeFromFile constructs the flags for the message using MessageFlagSetToStr prior to calling SendCmd using the IMAP4 APPEND command. 

AppendMsgNoEncodeFromFile calls the AppendMsgNoEncodeFromStream method perform the apopend operation. 

AppendMsgNoEncodeFromFile causes the APPEND command to be sent to the IMAP4 server using the indicated mailbox name, message flags, and the message size as stored in the mailbox. The value in AMBName is enclosed in double quotation marks to prevent errors with mailbox names that include the Space character. 

AppendMsgNoEncodeFromFile inspects the numeric response code in LastCmdResult, and when the value is IMAP_CONT sends the message headers, body, and attachments in AMsg to the IMAP4 server. 

AppendMsgNoEncodeFromFile returns False if the APPEND operation is not successfully completed on the IMAP4 server. 

Please note that the APPEND command is not used for message delivery, because it does not provide a mechanism to transfer SMTP envelope information. 

Use AppendMsgNoEncodeFromStream to append a message to a mailbox without encoding message parts prior to transmission, or AppendMsg to append a messgae specified in a TIdMessage instance.

Copyright 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Post feedback to the Indy Docs Newsgroup.