Namespaces

Variants
Actions

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

使用RSendAs发送电子邮件

From Wiki
Jump to: navigation, search
Article Metadata

文章
翻译:
hoolee
最后由 hamishwillee 在 14 Jun 2013 编辑

详细描述

使用下列代码发送电子邮件:

头文件:

#include <rsendas.h>
#include <rsendasmessage.h>
#include <senduiconsts.h>

需要的链接库:

LIBRARY  sendas2.lib

源文件:

RSendAs send;
User::LeaveIfError(send.Connect());
CleanupClosePushL(send);
 
RSendAsMessage sendAsMessage;
sendAsMessage.CreateL(send, KUidMsgTypeSMTP);
CleanupClosePushL(sendAsMessage);
 
sendAsMessage.SetSubjectL(_L("Welcome back to symbian"));
sendAsMessage.AddRecipientL(
_L("you@me.com"),SendAsMessage::ESendAsRecipientTo);
//adding to field
sendAsMessage.SetBodyTextL(_L("somebody@world.com"));
 
TRequestStatus status;
//adding attachments
sendAsMessage.AddAttachment(_L("c:\\splash.bmp"),status);
User::WaitForRequest(status);
 
sendAsMessage.SendMessageAndCloseL();
CleanupStack::Pop();
CleanupStack::PopAndDestroy();
This page was last modified on 14 June 2013, at 06:57.
83 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×