RSendAs to send sms/email...
| Fri, 2007-03-02 19:54 | |
|
|
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 ");_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 |






");
Forum posts: 1886
Have you signed your SIS file with a DevCert that has NetworkServices capability ?
Eric Bustarret
NewLC Founder & CEO / Professional Symbian OS Consultant
Forum posts: 148
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
Forum posts: 148
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
Forum posts: 4
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?
Forum posts: 4
Hi there Mayank
I have been able to implement the email and SMS functionalities. Thanks
Cheers
Karan
Forum posts: 4
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
Forum posts: 148
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
Forum posts: 3
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
Forum posts: 3
Another question,why does the program need allfiles capability?
Forum posts: 3
I have sent the email successfully.Thanks
However,why does the program need allfiles capability?
Forum posts: 4
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.