pp108 : GetMails

GetMails


This Web service operation is used to receive a set of mails from the mail server. To use this API, you must set a valid profile. If not, an 'Authentication Failed' error is thrown.

SOAP Request

<GetMails xmlns="http://schemas.cordys.com/1.0/email">
    <fromMessageId>298</fromMessageId>
    <toMessageId>299</toMessageId>
    <folder>INBOX</folder>
    <attachments>true</attachments>
    <includeHeaders>true</includeHeaders>
</GetMails>

Request Parameters

Parameter

Description

fromMessageId

Specifies the ID of the message from where the mails have to be retrieved.
messageID specifies the serial number of the mail in the mail box. It is always denoted in the reverse chronological order. Example: The messageId of the oldest mail is 1.

toMessageId

Specifies the ID of the message till where the mails must be retrieved.

folder

Specifies the folder in the mailbox from which the mails must be retrieved.

attachments

Specifies if the mail has an attachment to download.

includeHeaders

When set to 'true', displays the header information of the mail.


SOAP Response

<GetMailsResponse xmlns="http://schemas.cordys.com/1.0/email">
    <tuple>
        <old>
            <mail>
                <from>
                    <address>
                        <mailAddress>[email protected]</mailAddress>
                        <displayName>Steve Buchanan</displayName>
                    </address>
                </from>
                <to>
                    <address>
                        <mailAddress>[email protected]</mailAddress>
                        <displayName>Michael Suyama</displayName>
                    </address>
                </to>
                <flags>
                    <flag name="answered">false</flag>
                    <flag name="deleted">false</flag>
                    <flag name="draft">false</flag>
                    <flag name="flagged">false</flag>
                    <flag name="recent">false</flag>
                    <flag name="seen">true</flag>
                </flags>
                <subject>RE:</subject>
                <hasAttachments>false</hasAttachments>
                <sentDate>Tue Aug 20 12:34:17 IST 2002</sentDate>
                <headers>
                    <header name="header1">header Value</header>
                </headers>
            </mail>
        </old>
    </tuple>
    <tuple>
        <old>
            <mail>
                <from>
                    <address>
                        <mailAddress>[email protected]</mailAddress>
                        <displayName/>
                    </address>
                </from>
                <to>
                    <address>
                        <mailAddress>[email protected]</mailAddress>
                        <displayName>Michael Suyama</displayName>
                    </address>
                </to>
                <flags>
                    <flag name="answered">false</flag>
                    <flag name="deleted">false</flag>
                    <flag name="draft">false</flag>
                    <flag name="flagged">false</flag>
                    <flag name="recent">false</flag>
                    <flag name="seen">true</flag>
                </flags>
                <subject>RE:</subject>
                <hasAttachments>false</hasAttachments>
                <sentDate>Tue Aug 20 12:34:01 IST 2002</sentDate>
                <headers>
                    <header name="header1">header Value</header>
                </headers>
            </mail>
        </old>
    </tuple>
</GetMailsResponse>