언어 설정

Menu
Sites
Language
How to attach image to email

Hi.

I need to attach an image to email. I use code below for it:

    HashMap map;
    r = map.Construct(2);

    String subjectKey = L"http://tizen.org/appcontrol/data/subject";
    String subjectValue = txt_imageText->GetText();

    String attachKey = L"http://tizen.org/appcontrol/data/path";
    LinkedList attaches;
    attaches.Add(&filepath);

    map.Add(&subjectKey, &subjectValue);
    map.Add(&attachKey, &attaches);

    AppControl* ac = AppManager::FindAppControlN(L"tizen.email",
            L"http://tizen.org/appcontrol/operation/compose");

filepath is full path to my image file: /opt/apps/-appId-/shared/res/image.jpg . But when email client had appeared he hadn't image in attaches. My question is, which folder should I use to save my image if I want to put it in email.

Edited by: Brock Boland on 17 3월, 2014 Reason: Paragraph tags added automatically from tizen_format_fix module.

Responses

2 댓글
This has changed in sdk 2.2b. There is sample code in the documentation... The image file cannot be in data folder.. it must be in shared/data folder ... I don't know about shared/res folder. I will post full code shortly...
String destUri = App::GetInstance()->GetAppSharedPath() + "data/image.jpg"; HashMap extraData; extraData.Construct(); String subjectKey = L"subject"; String subjectVal = L""; String textKey = L"text"; String textVal = L""; String toKey = L"to"; String toVal = L""; String ccKey = L"cc"; String ccVal = L""; String bccKey = L"bcc"; String bccVal = L""; String attachKey = L"attachments"; String attachVal = destUri; extraData.Add(&subjectKey, &subjectVal); extraData.Add(&textKey, &textVal); extraData.Add(&toKey, &toVal); extraData.Add(&ccKey, &ccVal); extraData.Add(&bccKey, &bccVal); extraData.Add(&attachKey, &attachVal); AppControl* pAc = AppManager::FindAppControlN(L"tizen.email", L"http://tizen.org/appcontrol/operation/compose"); if (pAc) { pAc->Start(null, null, &extraData, null); delete pAc; } } ----------------------------- you can fill the values of To, cc, bcc, subject etc....