<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<HTML
><HEAD
><link rel='stylesheet' type='text/css' href='manpage.css'>
<!-- $Id: book.sgml,v 1.2 2003/07/09 21:33:20 mrsam Exp $ -->
<!-- Copyright 2002-2003 Double Precision, Inc.  See COPYING for -->
<!-- distribution information. -->
<meta name="MSSmartTagsPreventParsing" content="TRUE">
<link rel="icon" href="icon.gif" type="image/gif" />
<TITLE
>mail::ACCOUNT::copyMessagesTo</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
HREF="book.html"><LINK
REL="UP"
TITLE="mail::ACCOUNT Synchronous API reference"
HREF="synchronous.html"><LINK
REL="PREVIOUS"
TITLE="mail::ACCOUNT::checkNewMail"
HREF="account-checknewmail.html"><LINK
REL="NEXT"
TITLE="mail::ACCOUNT::createFolder"
HREF="account-createfolder.html"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
></TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="account-checknewmail.html"
ACCESSKEY="P"
>&#60;&#60;&#60; Previous</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="account-createfolder.html"
ACCESSKEY="N"
>Next &#62;&#62;&#62;</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="ACCOUNT-COPYMESSAGESTO"
></A
>mail::ACCOUNT::copyMessagesTo</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN2132"
></A
><H2
>Name</H2
>mail::ACCOUNT::copyMessagesTo&nbsp;--&nbsp;Copy messages to another folder</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN2135"
></A
><H2
>Synopsis</H2
><P
CLASS="LITERALLAYOUT"
>#include&nbsp;&#60;libmail/sync.H&#62;<br>
<br>
<br>
mail::ACCOUNT&nbsp;*mail;<br>
mail::folder&nbsp;*folder;</P
><DIV
CLASS="FUNCSYNOPSIS"
><A
NAME="AEN2137"
></A
><P
></P
><P
><CODE
><CODE
CLASS="FUNCDEF"
>bool ok=mail-&#62;<TT
CLASS="FUNCTION"
>copyMessagesTo</TT
></CODE
>(const std::vector&#60;size_t&#62; &#38;<TT
CLASS="PARAMETER"
><I
>msgList</I
></TT
>, mail::folder *<TT
CLASS="PARAMETER"
><I
>copyTo</I
></TT
>);</CODE
></P
><P
></P
></DIV
><P
CLASS="LITERALLAYOUT"
>std::string&nbsp;errmsg=mail-&#62;getErrmsg();</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN2146"
></A
><H2
>USAGE</H2
><P
><TT
CLASS="PARAMETER"
><I
>msgList</I
></TT
> specifies a list of messages.
Messages are numbered starting with message #0 and up to one
less than
<A
HREF="account-getfolderindexsize.html"
><SPAN
CLASS="CITEREFENTRY"
><SPAN
CLASS="REFENTRYTITLE"
>mail::ACCOUNT::getFolderIndexSize</SPAN
>(3x)</SPAN
></A
>
(when <TT
CLASS="FUNCTION"
>mail::account::getFolderIndexSize</TT
> returns 6,
the messages are numbered 0 through 5).
Only the messages that appear in <TT
CLASS="PARAMETER"
><I
>msgList</I
></TT
> are
processed by this request.
When a message is removed from the folder, by
<A
HREF="account-updatefolderindexinfo.html"
><SPAN
CLASS="CITEREFENTRY"
><SPAN
CLASS="REFENTRYTITLE"
>mail::ACCOUNT::updateFolderIndexInfo</SPAN
>(3x)</SPAN
></A
>,
the following messages are renumbered accordingly.</P
><DIV
CLASS="NOTE"
><P
></P
><TABLE
CLASS="NOTE"
WIDTH="100%"
BORDER="0"
><TR
><TD
WIDTH="25"
ALIGN="CENTER"
VALIGN="TOP"
>NOTE:</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><P
>Most mail servers allow multiple applications to open the same folder.
Therefore, changes to the folder's contents can occur at any time.
Before making this request, the application should use
<A
HREF="account-checknewmail.html"
><SPAN
CLASS="CITEREFENTRY"
><SPAN
CLASS="REFENTRYTITLE"
>mail::ACCOUNT::checkNewMail</SPAN
>(3x)</SPAN
></A
> to verify that
no unexpected changes have been made to the folder's contents.</P
></TD
></TR
></TABLE
></DIV
><P
><TT
CLASS="FUNCTION"
>mail::ACCOUNT::copyMessagesTo</TT
> copies messages in the
currently-open folder to another folder.
<TT
CLASS="PARAMETER"
><I
>copyTo</I
></TT
> is a pointer to a
<SPAN
CLASS="STRUCTNAME"
>mail::folder</SPAN
> object, representing the folder where
messages are copied to.
If <TT
CLASS="VARNAME"
>account</TT
> is an IMAP account and
<TT
CLASS="PARAMETER"
><I
>copyTo</I
></TT
> is another folder in the same account, then
the messages are quickly copied by the IMAP server.
Otherwise each message is individually downloaded and copied to the
<TT
CLASS="PARAMETER"
><I
>copyTo</I
></TT
> folder.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN2173"
></A
><H2
>Return Codes</H2
><P
>This method returns <TT
CLASS="LITERAL"
>true</TT
> if it succeeds, or
<TT
CLASS="LITERAL"
>fail</TT
> if it fails.
If the method fails, use
<TT
CLASS="STRUCTFIELD"
><I
>mail::ACCOUNT::getErrmsg()</I
></TT
> to read a brief
description of the error.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN2179"
></A
><H2
>SEE ALSO</H2
><P
><A
HREF="account-searchmessages.html"
><SPAN
CLASS="CITEREFENTRY"
><SPAN
CLASS="REFENTRYTITLE"
>mail::ACCOUNT::searchMessages</SPAN
>(3x)</SPAN
></A
>.</P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="account-checknewmail.html"
ACCESSKEY="P"
>&#60;&#60;&#60; Previous</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="book.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="account-createfolder.html"
ACCESSKEY="N"
>Next &#62;&#62;&#62;</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>mail::ACCOUNT::checkNewMail</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="synchronous.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>mail::ACCOUNT::createFolder</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>