Hi guys:
I have a problem with RSendAsMessage. I create a new message (email) with an attachment. But when I call SendMessageAndCloseL, this message is only sitting in the Drafts. If I take off the attachment, the message can be sent immediately. Does anyone know what is going wrong? Why can't I send an email with attachment directly? Thanks in advance! The following are my codes:
........
iSendAs.Connect();
.......
iSendAsMessage.CreateL(iSendAs,KSenduiMtmSmtpUid);
iSendAsMessage.AddRecipientL(*aTo, RSendAsMessage::ESendAsRecipientTo);
iSendAsMessage.SetSubjectL(*aSubject);
TFileName attach(aFileToSend);
iSendAsMessage.AddAttachment(attach, iStatus);
iState = ECreatingMessage;
SetActive();
// the following are in the run():
switch(iState)
{
case ECreatingMessage:
{
iSendAsMessage.SendMessage(iStatus);
iState = ESendingMessage;
SetActive();
}
break;
case ESendingMessage:
{
this->iSendAsMessage.Close();
CAknConfirmationNote* note;
note = new ( ELeave ) CAknConfirmationNote();
note->ExecuteLD( _L("message sent"😉);
}
break;
Edit/Delete Message