CImIAPPreferences* accessPointPrefs;
accessPointPrefs=SetupConnectionL();
CImSmtpSettings *smtpSettings = new ( ELeave ) CImSmtpSettings;
CleanupStack::PushL( smtpSettings );
smtpSettings->Reset();
smtpSettings->SetEmailAddressL( KEmailAddress );
smtpSettings->SetReplyToAddressL( KEmailAddress );
smtpSettings->SetReceiptAddressL( KEmailAddress );
smtpSettings->SetLoginNameL( KSmtpLogin );
smtpSettings->SetPasswordL( KSmtpPass );
smtpSettings->SetRequestReceipts( EFalse );
smtpSettings->SetSendCopyToSelf( ESendCopyAsBccRecipient );
smtpSettings->SetSendMessageOption( ESendMessageImmediately );
smtpSettings->SetServerAddressL( KServerAddress );
smtpSettings->SetPort( KSMTPDefaultPortNumber );
smtpSettings->SetSecureSockets( ETrue );
smtpSettings->SetSMTPAuth(EFalse);
smtpSettings->SetBodyEncoding(EMsgOutboxNoAlgorithm);
// this function does not seem to work with any parameter...
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("abc.xyz@gmail.com"),RSendAsMessage::ESendAsRecipientTo);
TBuf<100> obj;
sendAsMessage.SetBodyTextL(_L("<html><body>
Some more html tags</body></html>"));
sendAsMessage.SendMessageAndCloseL();
iRunning = ETrue;
_LIT(KConnecting,"Connecting...");
CleanupStack::Pop();
CleanupStack::Pop();
CleanupStack::PopAndDestroy();