Send a new email in Qt
m (moved Send a new email in QT to Send a new email in Qt: Moved Send a new email in QT to Send a new email in Qt) |
hamishwillee
(Talk | contribs) m (Hamishwillee - Addition to article of: Category:MeeGo Category:Symbian. (Add platform categories)) |
||
| Line 45: | Line 45: | ||
* [[Send MMS using Qt Mobility]] | * [[Send MMS using Qt Mobility]] | ||
* [[Read and Send messages in Qt for Symbian]] | * [[Read and Send messages in Qt for Symbian]] | ||
| − | * [[Delete messages using Qt Mobility API in Qt for Symbian]] | + | * [[Delete messages using Qt Mobility API in Qt for Symbian]][[Category:MeeGo]] [[Category:Symbian]] |
Revision as of 08:53, 15 February 2012
This code example shows how to send an email using the Qt Mobility messaging API.
Article Metadata
//Create message service objects
QMessageServiceAction* msgAction = new QMessageServiceAction ( this);
// Create a new email
QMessage msg;
msg.setType(QMessage::Email);
// Add required parameters
msg.setTo (QMessageAddress("qt@forum.nokia.com",QMessageAddress::Email));
msg.setSubject("QT email example");
//Set message body
msg.setBody("This is test message!");
// Add Attachments
QStringList attachments;
attachments.append("abc.jpg");
msg.appendAttachments(paths);
//Send email message
msgAction->send(msg);

