Read-only archive of the All About Symbian forum (2001–2013) · About this archive

problem with RSendAsMessage

0 replies · 950 views · Started 12 April 2006

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