Symbian3/SDK/Source/GUID-D73AD200-BE4D-50BF-BCF9-14627DE530B7.dita
changeset 0 89d6a7a84779
equal deleted inserted replaced
-1:000000000000 0:89d6a7a84779
       
     1 <?xml version="1.0" encoding="utf-8"?>
       
     2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
       
     3 <!-- This component and the accompanying materials are made available under the terms of the License 
       
     4 "Eclipse Public License v1.0" which accompanies this distribution, 
       
     5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
       
     6 <!-- Initial Contributors:
       
     7     Nokia Corporation - initial contribution.
       
     8 Contributors: 
       
     9 -->
       
    10 <!DOCTYPE concept
       
    11   PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
       
    12 <concept id="GUID-D73AD200-BE4D-50BF-BCF9-14627DE530B7" xml:lang="en"><title>Imap4Example:
       
    13 An Email manager using IMAP4 and SMTP</title><prolog><metadata><keywords/></metadata></prolog><conbody>
       
    14 <section id="GUID-A3DDBA67-40D7-572D-A5CE-ED78D7A977DC"><title>Description</title> <p>This
       
    15 example application demonstrates how to create SMTP (Simple Mail Transfer
       
    16 Protocol) and IMAP (Internet Message Access Protocol) accounts to send and
       
    17 receive emails respectively. The application creates dummy messages and sends
       
    18 them using SMTP. </p> <p>The application starts a session with the messaging
       
    19 server using <xref href="GUID-2DA04D96-F0AD-3FDC-9E36-1C27D889AF4B.dita#GUID-2DA04D96-F0AD-3FDC-9E36-1C27D889AF4B/GUID-423E2320-FB34-3249-80D9-9AA62C9DDF60"><apiname>CMsvSession::OpenSyncL()</apiname></xref> and gets an instance
       
    20 of the client MTM (Message Type Module) registry using <xref href="GUID-A0682D04-9084-3DC3-AA18-5B81A78A1DA8.dita#GUID-A0682D04-9084-3DC3-AA18-5B81A78A1DA8/GUID-DBD7038B-A0E2-3791-A4C9-3A22FFCA146A"><apiname>CClientMtmRegistry::NewL()</apiname></xref>.
       
    21 Using this registry it creates IMAP4 client-side MTM objects for the specified
       
    22 UID. </p> <p>After creating the client MTM objects, the application creates
       
    23 IMAP4 and SMTP accounts using <xref href="GUID-A7EF08E6-82AF-3577-B942-ABD532EDB7FE.dita#GUID-A7EF08E6-82AF-3577-B942-ABD532EDB7FE/GUID-3FECFA5C-3C53-3BD2-A710-D6069C08EB08"><apiname>CEmailAccounts::CreateImapAccountL()</apiname></xref> and <xref href="GUID-A7EF08E6-82AF-3577-B942-ABD532EDB7FE.dita#GUID-A7EF08E6-82AF-3577-B942-ABD532EDB7FE/GUID-89066942-2526-3B2E-B6DC-FCEF9EC2EFB6"><apiname>CEmailAccounts::CreateSmtpAccountL()</apiname></xref> respectively.
       
    24 Settings and preferences for these accounts are configured using the <xref href="GUID-55F11633-988C-39D5-ADE7-23C4966FD995.dita"><apiname>CImImap4Settings</apiname></xref>, <xref href="GUID-9CAB9BE5-7233-3A01-A906-756177CF4460.dita"><apiname>CImIAPPreferences</apiname></xref> and <xref href="GUID-DFE18962-0022-3833-A8F0-6E4C969177C0.dita"><apiname>CImSmtpSettings</apiname></xref>. </p> <p>A simple SMTP message is created by the
       
    25 application using the <xref href="GUID-3F7DC1AB-D13C-31E9-967B-526AD72CD498.dita#GUID-3F7DC1AB-D13C-31E9-967B-526AD72CD498/GUID-FCDC47D2-0446-3CD7-A246-4DCED7C8A063"><apiname>CImEmailOperation::CreateNewL()</apiname></xref> function,
       
    26 and then sent to the email address stored in the literal <codeph>KTo</codeph>. </p> <p> <b>Note</b>:
       
    27 Each email account created by the application has a pair of service entries,
       
    28 which are used to store settings required for email transport. </p> <p>The
       
    29 application also provides the <codeph>CMessAsyncWaiter</codeph> class to issue
       
    30 asynchronous requests to the messaging server and handles completed requests.
       
    31 This class implements the <xref href="GUID-067293BF-B28C-3CEC-92F4-1351A795EA7F.dita"><apiname>CActive</apiname></xref> abstract interface. </p> </section>
       
    32 <section id="GUID-F52C49C9-3072-5046-B5EF-F4C22CAEBD0F"><title>Download</title> <p>Click
       
    33 on the following link to download the example: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/zips/guid-62d00653-18c4-48af-94b0-4debade064f2.zip" scope="external">Imap4Example.zip</xref></p><p>Click: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/guid-62d00653-18c4-48af-94b0-4debade064f2.html" scope="peer">browse</xref> to view the example code. </p> </section>
       
    34 <section id="GUID-7AE47DB2-8A48-54AC-8BD8-1A3CE5573331"><title>Pre-requisites</title> <p>A
       
    35 null modem cable (NTRAS - New Technology Remote Access Services) must be connected
       
    36 to your system for the example to be functional. Also, change the values of
       
    37 literals <codeph>KSmtpServerAddress</codeph> and <codeph>KImapServer</codeph> defined
       
    38 in the <filepath>imap4example.cpp</filepath> file to your system address. </p> <p>In
       
    39 addition to the above mentioned changes, you must have an account with the
       
    40 messaging server. You can create an account using any messaging proxy server
       
    41 application such as Communigate-Pro, which is freely downloadable from <xref href="http://www.stalker.com/CommuniGatePro/#Current" scope="external">http://www.stalker.com/CommuniGatePro/</xref>.
       
    42 The name of the newly created account can either be the account name used
       
    43 by the application or a different one. If you choose to name the new account
       
    44 different from the account name used by the application, change the value
       
    45 of the literal <codeph>KImapLoginName</codeph> defined in the <filepath>imap4example.cpp</filepath> file
       
    46 to the new account name. </p> <p> <b>Note</b>: To check the messages sent
       
    47 by the application, you must configure your email client to retrieve messages
       
    48 for the newly created IMAP4 account. For information on how to configure your
       
    49 email client, refer its user guide. </p> </section>
       
    50 <section><title>Class Summary</title><p><xref href="GUID-A7EF08E6-82AF-3577-B942-ABD532EDB7FE.dita"><apiname>CEmailAccounts</apiname></xref></p><p> <xref href="GUID-BDE23754-4536-3AF7-8549-3B953F51167C.dita"><apiname>MMsvSessionObserver</apiname></xref></p><p> <xref href="GUID-513528C7-4741-3494-9272-4E8F6CDBF20F.dita"><apiname>TMsvSessionEvent</apiname></xref></p><p> <xref href="GUID-A0682D04-9084-3DC3-AA18-5B81A78A1DA8.dita"><apiname>CClientMtmRegistry</apiname></xref></p><p> <xref href="GUID-2DA04D96-F0AD-3FDC-9E36-1C27D889AF4B.dita"><apiname>CMsvSession</apiname></xref></p><p> <xref href="GUID-177AF50B-14EF-3C45-AE22-1FEE5678261D.dita"><apiname>CBaseMtm</apiname></xref></p><p> <xref href="GUID-AF724192-6580-3DE3-9287-3A005C0AA932.dita"><apiname>CMsvOperation</apiname></xref></p><p> <xref href="GUID-A4B1F874-27C0-3BB6-9D29-C35C75A5DB98.dita"><apiname>TMsvId</apiname></xref></p><p> <xref href="GUID-12FC6AC7-8946-324D-B2B7-60B332870794.dita"><apiname>TImapAccount</apiname></xref></p><p> <xref href="GUID-C1545507-56B1-3533-9D7D-1F17F95AB6F8.dita"><apiname>TSmtpAccount</apiname></xref></p><p> <xref href="GUID-067293BF-B28C-3CEC-92F4-1351A795EA7F.dita"><apiname>CActive</apiname></xref> </p></section>
       
    51 <section id="GUID-ABD7370A-98DF-58D0-90F7-72684A11798E"><title>Build</title> <p>The <xref href="GUID-3100800B-B2F7-50EF-BD4C-3C345ECCB2A5.dita">Symbian OS build process</xref> describes
       
    52 how to build an application. </p> <p>The IMAP4 example builds an executable
       
    53 called <filepath>impa4Example.exe</filepath> in the standard location (<filepath>\epoc32\release\winscw\</filepath> <i>&lt;build_variant&gt;</i> for
       
    54 CodeWarrior). After launching the executable, depending on the emulator you
       
    55 are using, you may need to task away from the app launcher/shell screen to
       
    56 view the console. </p> </section>
       
    57 <section id="GUID-43E4D1FA-8CF0-5F5B-A166-30AE01E6D961"><title>See also</title> <p> <xref href="GUID-1F755804-70D6-5635-B2F7-06F03C8D4B74.dita">IMAP4 MTM Overview</xref>  </p> <p> <xref href="GUID-4F703F85-080F-5B77-B94D-5449764828F3.dita">SMTP MTM Overview</xref>  </p> </section>
       
    58 </conbody></concept>