RSendAs to send sms/email...

Login to reply to this topic.
Fri, 2007-03-02 19:54
Joined: 2004-06-22
Forum posts: 148
Hi,

I use the following code to send sms...

RSendAs sendas;
    TInt res = sendas.Connect();
    CleanupClosePushL(sendas);


    RSendAsMessage message;
    TRAP(res, message.CreateL(sendas, KSenduiMtmSmsUid));
    CleanupClosePushL(message);

    _LIT(KText, "Test test Cheezy");
    _LIT(KNumber, "99998928");
    TRequestStatus status;

    message.AddRecipientL(KNumber, RSendAsMessage::ESendAsRecipientTo);
    message.SetBodyTextL(KText);

    // send the message
    CleanupStack::Pop(1); // RMessage
    TRAP(res, message.SendMessageAndCloseL());

    CleanupStack::PopAndDestroy(1); // RSendAs

it works fine..except for the fact tat it asks the user for confirmation b4 sending the mesage..i believe this has something to do with security...can someone please clarify what needs to be added to get rid of that confirmation message...

Basically i want to send sms/email programatically without asking the user for anything..!!

Also if i change the mtm id to KSenduiMtmSmtpUid ...for sending email..the app crashes...can someone tell me why...!

Cheeers
mayank

Mon, 2007-03-05 17:59
NewLC AdministratorSymbian AccreditedForum Nokia Champion
Joined: 2003-01-14
Forum posts: 1886
Re: RSendAs to send sms/email...
I use similar code (http://www.newlc.com/Programatically-sending-an-SMS.html) and no confirmation is asked.

Have you signed your SIS file with a DevCert that has NetworkServices capability ?

Eric Bustarret
NewLC Founder & CEO / Professional Symbian OS Consultant

Mon, 2007-03-05 18:33
Joined: 2004-06-22
Forum posts: 148
Re: RSendAs to send sms/email...
Hi,

Solved the sms part fine..

but the email bit still remains a grey area..

as when i do :-

   TRAP(res, message.CreateL(sendas, KSenduiMtmSmtpUid ));
   
the app crashes with kern exec 0

can someone throw some light on how to programatically send email messages out...?

Cheers
mayank
Tue, 2007-03-06 07:01
Joined: 2004-06-22
Forum posts: 148
Re: RSendAs to send sms/email...
Got it to work...Smiley

Need to set the Email settings in the messaging application..

and apart from the code pasted above..in the mmp file..the following capabilities should go as well..:-

CAPABILITY     NetworkServices AllFiles ReadDeviceData WriteDeviceData

However it would be nice if someone can point out why ReadDeviceData and WriteDeviceData capabilities are required to send email..while the same r not required to send sms out..

Cheers
mayank
Mon, 2008-04-28 07:31
Joined: 2008-01-29
Forum posts: 4
Re: RSendAs to send sms/email...

Hi Mayank

I read your blog, I am also doing the same thing i.e. programatically sending the email and not asking user to enter any details.
My email recipients are fixed.
My doubts are the following
1. In the code snippet how can I enter the email ID
2. How to create the message
3. Attachments?

Mon, 2008-04-28 11:20
Joined: 2008-01-29
Forum posts: 4
Re: RSendAs to send sms/email...

Hi there Mayank

I have been able to implement the email and SMS functionalities. Thanks

Cheers
Karan

Tue, 2008-04-29 06:18
Joined: 2008-01-29
Forum posts: 4
Re: RSendAs to send sms/email...

Dear Mayank

I I have implemented for SMS, email but when I try for MMS by using the mtm uid. I m getting feature not supported.

Cheers

Tue, 2008-04-29 06:27
Joined: 2004-06-22
Forum posts: 148
Re: RSendAs to send sms/email...

Hi,

For MMS I havent tried, does your phone support MMS...and for MMS I believe there are some network operator specific settings you might have to do..like create a MMS profile on the device or something on those lines..

Cheers
mayank

Thu, 2008-05-22 03:27
Joined: 2008-05-22
Forum posts: 3
Re: RSendAs to send sms/email...

hello,mayank and karan,

I also met the problem when sending email by using rsendas and rsendasmessage,my code can create a message in the outbox,but cannot send it successfully.My code is like mayank's,using KSenduiMtmSmtpUid replacing KSenduiMtmSmsUid,I don't know where my problem is, hope for help,

Cheers

Thu, 2008-05-22 04:10
Joined: 2008-05-22
Forum posts: 3
Re: RSendAs to send sms/email...

Another question,why does the program need allfiles capability?

Thu, 2008-05-22 04:35
Joined: 2008-05-22
Forum posts: 3
Re: RSendAs to send sms/email...


I have sent the email successfully.Thanks
However,why does the program need allfiles capability?

Thu, 2008-06-26 15:32
Joined: 2008-01-29
Forum posts: 4
Re: RSendAs to send sms/email...

I am now facing a peculiar problem, the email code is working,
however I am not getting the email. I am unable to find any problems
with the code. I used KSenduiMtmSmtpUid for email and gave the right email id.
I have added the subject field also.

and why are we using this TRequestStatus status;

Can anybody help out.

  • Login to reply to this topic.