×
Namespaces

Variants
Actions

使用RSendAs发送电子邮件

From Nokia Developer 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 09:57.
84 page views in the last 30 days.
×