|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the License "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // STLport regression testsuite component. |
|
20 // To compile as a separate example, please #define MAIN. |
|
21 |
|
22 #include<e32base.h> |
|
23 |
|
24 #include "messagingservice.h" |
|
25 #include <CMsvAttachment.h> |
|
26 #include "sendmessage.h" |
|
27 |
|
28 #ifdef MAIN |
|
29 #define sendmessage_test5 main |
|
30 #endif |
|
31 |
|
32 |
|
33 |
|
34 int sendmessage_test5(int, char**) |
|
35 { |
|
36 |
|
37 __UHEAP_MARK; |
|
38 TInt result = KErrNone; |
|
39 |
|
40 CMessagingService* test = (CMessagingService* ) CMessagingService::NewL() ; |
|
41 CleanupStack::PushL(test); |
|
42 |
|
43 CSendMessageParams* messageParam = CSendMessageParams::NewL(); |
|
44 CleanupStack::PushL(messageParam); |
|
45 |
|
46 messageParam->SetLaunchEditor(ETrue); |
|
47 |
|
48 messageParam->AddRecipientL(_L("9008032761")); |
|
49 |
|
50 messageParam->SetMessageTypeL(_L("MMS")); |
|
51 |
|
52 messageParam->SetBodyTextL(_L("Hi How are you!!! Its the first mms from imessaging")); |
|
53 |
|
54 messageParam->SetSubjectL(_L("MMS")); |
|
55 |
|
56 CMsvAttachment* element = CMsvAttachment::NewL(CMsvAttachment::EMsvFile); |
|
57 element->SetMimeTypeL(_L8("image/jpeg")); |
|
58 element->SetAttachmentNameL(_L("c:\\data\\images\\test1.jpg")); |
|
59 messageParam->AddAttachmentL(element); |
|
60 |
|
61 element = CMsvAttachment::NewL(CMsvAttachment::EMsvFile); |
|
62 element->SetMimeTypeL(_L8("image/jpeg")); |
|
63 element->SetAttachmentNameL(_L("c:\\data\\images\\test2.jpg")); |
|
64 messageParam->AddAttachmentL(element); |
|
65 |
|
66 TRAP(result, test->SendMessageL(messageParam, NULL)); |
|
67 |
|
68 CleanupStack::PopAndDestroy(2, test); |
|
69 |
|
70 __UHEAP_MARKEND; |
|
71 |
|
72 return result; |
|
73 } |