[SOLVED]Invoke External e-mail and set HTML content
-
wrote on 9 Mar 2012, 11:33 last edited by
Hi all,
i need, in my app, to send a mail. Exist the possibility to launch the program E-mail of Symbian and pass it some parametre for write a mail?
Regards
[edit: fixed typo in title, eddy]
-
wrote on 9 Mar 2012, 11:49 last edited by
Hi,
did you look at the "messaging API":http://doc.qt.nokia.com/qtmobility-1.2/messaging.html of QtMobility?
-
wrote on 9 Mar 2012, 11:53 last edited by
Yes but I not have found a method to invok the e-mail process, whit this method i have to costruct all form.
I wont invok app i don't wont creat all form
is possible?
-
wrote on 9 Mar 2012, 13:32 last edited by
As Gerolf said you should use Qt Mobility. Key classes for your case are "QMessage":http://doc.qt.nokia.com/qtmobility/qmessage.html and "QMessageService":http://doc.qt.nokia.com/qtmobility/qmessageservice.html. Method "compose":http://doc.qt.nokia.com/qtmobility/qmessageservice.html#compose will open the default composer application using message as a prototype. Example:
@
QMessageService* pMessageManager = new QMessageService(this);
QMessage message;
message.setType(QMessage::Email);
message.setBody("your message");
pMessageManager->compose(message);
@Btw using the same approach you can open the default app for SMS or MMS (of course it works on both Symbian and MeeGo devices).
-
wrote on 9 Mar 2012, 14:33 last edited by
I have found this method and run... wath do you think?
@DesktopServices::openUrl(QUrl("mailto:user@foo.com?subject=Test&body=Just a test"))@
-
wrote on 9 Mar 2012, 14:36 last edited by
[quote author="Vetryaspa" date="1331303594"]I have found this method and run... wath do you think?
@DesktopServices::openUrl(QUrl("mailto:user@foo.com?subject=Test&body=Just a test"))@[/quote]
In my opinion even if this works it would be much better to use the standard solution with Qt Mobility QMessage and QMessageService which I recommended in my previous post.
-
wrote on 9 Mar 2012, 14:40 last edited by
ok!! if i would sand messag in HTML format how i can do it? because the bady was not formatted in HTML even if i insert some HTML code
-
wrote on 9 Mar 2012, 14:46 last edited by
[quote author="Vetryaspa" date="1331304023"]ok!! if i would sand messag in HTML format how i can do it? because the bady was not formatted in HTML even if i insert some HTML code[/quote]
The official documentation includes an "example how to compose e-mail with HTML content":http://doc.qt.nokia.com/qtmobility/serviceactions.html.
-
wrote on 16 Apr 2012, 16:25 last edited by
[quote author="leon.anavi" date="1331304383"]
[quote author="Vetryaspa" date="1331304023"]ok!! if i would sand messag in HTML format how i can do it? because the bady was not formatted in HTML even if i insert some HTML code[/quote]The official documentation includes an "example how to compose e-mail with HTML content":http://doc.qt.nokia.com/qtmobility/serviceactions.html.
[/quote]this code not run, where is the probelm?
@ QString testo;
testo.append("<HTML CONTENT TEXT>"); QMessageService* pMessageManager = new QMessageService(this); QMessage message; message.setType(QMessage::Email); message.setSubject(rist->value("NOME_RISTORANTE")); QString htmlBody("<html><head></head><body>%1</body></html>"); message.setBody(htmlBody.arg(testo),"text/html"); pMessageManager->compose(message);@
Why not run?
-
wrote on 18 Apr 2012, 08:32 last edited by
no body can help me?
-
wrote on 30 Apr 2012, 12:52 last edited by
Official documentation says:
On Symbian platform email messages with HTML body cannot be sent. If HTML content needs to be sent it can be added as attachment.
-
wrote on 30 Apr 2012, 12:58 last edited by
[quote author="adrz1" date="1335790370"]Official documentation says:
On Symbian platform email messages with HTML body cannot be sent. If HTML content needs to be sent it can be added as attachment.[/quote]
Ok... Tnx for Answer
-
wrote on 30 Apr 2012, 13:54 last edited by
@
QDesktopServices::openUrl(QUrl("mailto:user@foo.com?subject=Test&body=Just a test"))
@
Some times ago I used this to open my default mail client and I think it's not so bad...