After mucking round with OPL for a bit now I've spotted a problem with the core.opl,which with the aid of Ewan, has been trace to the "Init_SetupSendAsKeysAndMenu:" call which is used to initalise links to the messaging client for such things as (in the case of core.opl) an "E-mail the Author" link. This works without error on the emulator and on the latest firmware. I am running firmware 3.57 so somewhere between there and 4.13 something was changed that made this work. The downside is that if someone has a phone running the older firmwares they may be hit by this problem which stops the program running from the word go with a couple of big fat error messages.
I know Ewan has posted this with regard to the Core.opl but I thought best to post a mildly better description and explanation for people not using core.opl and who would skip that post.
That also uses SendAs.opx - it used to seem to work OK for me on 3.53 as well as 4.13...and 5.xx too.
It's causing me headaches, so the easiest way is to leave it out till the bugs are sorted from Symbian's end. Okay you loose a direct "Email the Author" which is cute but not 100% nessecary.
Let's keep it simple till we get a head of steam with a good number of active OPL users on here!
Doesn't the following work?
First get your ID for mail:
[code:1]
PROC GetMailKey%:
LOCAL i%,SaMaxTypes&,key%
i%=1
SaScanSendAsTypes:
SaMaxTypes&=SaMaximumTypes&:
WHILE i%<=SaMaxTypes&
REM here I search for KUidMtmSMSValue& but for mail you should replace it by one of these: KUidMtmEmailSyncValue&, KUidMtmSMTPValue&, KUidMtmPOP3Value& or KUidMtmIMAP4Value&
IF SaUid&:(i%)=KUidMtmSMSValue&
key%=i%
i%=SaMaxTypes&
ENDIF
i%=i%+1
ENDWH
RETURN key%
ENDP[/code:1]
Then make the message:
[code:1]PROC OpenNew:(key%)
LOCAL body&
body&=SaNewBody&:
SaPrepareMessage:(key%)
SaAppendToBody:("I love your app!!!!")
SaSetBody:(body&)
SaAddRecipient:("[email protected]")
SaLaunchSend:
SaDeleteBody:
ENDP[/code:1]
This is how make a new sms, the code should be the same you only have to find the correct KUidMtm*Value&
[quote="Ewan-FreEPOC"]It's causing me headaches, so the easiest way is to leave it out till the bugs are sorted from Symbian's end. Okay you loose a direct "Email the Author" which is cute but not 100% nessecary.[/quote]
Yes, but I'm curious if this is a defect in OPL (SendAs.opx) or not...it shouldn't be! During testing the OPX code worked OK on the range of firmwares I posted above.
In fact, the SendAs code is based on the CSendAs class and other functionality in the original 9210 codeline (i.e. the 3.xx firmwares) rather than the 9210i codeline or the 4.xx codeline. If it should work on anything it should be 3.xx 😊
Phil
Hi,
I am using a Nokia 9290 fw3.35, and I have success running the "Email high scores" feature for my game "Smuggers". Both from the Nokia 9210i emulator on Windows and from the real Nokia machine.
The problems cited in this thread have been solved ? Because I am almost in time to release a new version of "Smuggers" and I would like to know if it is safe to implement the send email code in OPL.
A minor problem, "SaSetSubject%😞text$)" does not work, the subject of the email remains empty. But I can show a text message asking the user to fill it. Any hints ?
Regards,
Roberto
We are using the SendAs in several OPL applications and have encountered this problem many times. I have discussed it in discussion.epoc.opl before.
What we have found so far is that the problem is version independent, assumed that we talk about the same one, and of course assumed that our findings are accurate. Instead we think it is anomalies within the MTM Registry. The workaround is to rename the MTM Registry file. But this means that you will lose fax functionality etc, so you will have to rename it back again.
cheers
Martin
Sorry, posted as Guest by mistake above. Here is the same posting with some additions.
We are using the SendAs in several OPL applications and have encountered this problem many times. In particular our only two applications to date which have been distributed to consumers, dpLatin and dpQuran, have had some users reporting the error. In total we have a couple of hundred users of these products on the Nokia 9210/9290, and in most cases there have not been any problems.
But looking through the statistics, we cannot find any relation between the occurrences of these errors and the firmware version. We have also been able to replicate the error on the 9210, 9210i and 9290.
I have discussed this problem in discussion.epoc.opl before with Phil. Phil suggested that it might have to do with our use of asynchronous event handling, but why can we then replicate the problem with a simple:
INCLUDE "SendAs.oxh"
PROC main:
SetupSendAsKeysAndMenu:
ENDP
?
What we have found so far is that the problem is firmware version independent - and please tell me if anyone has found otherwise - and of course assumed that we talk about the same problem.
Instead we think it is anomalies within the MTM Registry. It seems SetupSendAsKeysAndMenu: encounters corruptions within the MTM Registry and exits.
Some users have experienced the problem when they have been setting up faxing, which creates an MTM Registry entry. The workaround we have used is to rename the MTM Registry file, but that is of course a horrible workaround, since this means that you will lose fax functionality etc, so you will have to rename it back again.
cheers
Martin
Thanks Martin for explaining your experience with this problem.
Just to confirm : when you say "this problem", I suppose it is the major problem of program abort due to "SetupSendAsKeysAndMenu:".
What about the minor problem, of "SaSetSubject%😞text$)" not working so the subject of the email remains empty ? Does it happens to everybody or is it rare ?
Best regards,
Roberto
[quote="Roberto"]Thanks Martin for explaining your experience with this problem.
Just to confirm : when you say "this problem", I suppose it is the major problem of program abort due to "SetupSendAsKeysAndMenu:".
What about the minor problem, of "SaSetSubject%😞text$)" not working so the subject of the email remains empty ? Does it happens to everybody or is it rare ? [/quote]
Correct. I am talking about the major one. We have not actually come across the minor one...yet.
cheers / Martin
Another confirmation :
have you used the "SaSetSubject%:" without any problems (i.e., the subject is not blank) ?
or
have you not used it at all ? So you do not know whether "SaSetSubject%:" is problematic or not ?
Sorry if I am boring looking after more details...
Thanks in advance,
Roberto
We have not had any problems with this function so far, but on the other hand we have not used it much either. We have mainly been using the SMS functions which do not need the subject field.
Here is an example of how we use it in our apps - I guess most ideas are taken from Phil's OPLdemo app - to make it easy for users to send feedback to us via Email.
PROC EmailSendToAuthor
EXTERNAL GSaKeys&()
LOCAL pBody&
IF GSaKeys&(4)=0
Message("Cannot send email at this time"😉
RETURN
ENDIF
ONERR LBL_cleanup
BUSY "Preparing Email�"
pBody&=SaNewBody&
SaPrepareMessage(GSaKeys&(4))
SaSetSubject%("User comment about "+KApplicationName$+" etc"😉
SaSetBody(pBody&😉
SaAppendToBody("-----"+NewLine$+"Email regarding"+NewLine$+"----"😉
SaAddRecipient(KEmailAddressDigitalProgress$)
SaLaunchSend
SaDeleteBody
BUSY OFF
ONERR OFF
RETURN
LBL_cleanup
ONERR OFF
BUSY OFF
InfoDialogue("Error - Cannot send email at this time","",""😉
IF pBody& SaDeleteBody ENDIF
ENDP
cheers
Martin