Send a new email in Qt
hamishwillee
(Talk | contribs) m (Set correct categories) |
hamishwillee
(Talk | contribs) m (Add messaging category) |
||
| Line 1: | Line 1: | ||
| − | [[Category:Qt Mobility]] | + | [[Category:Messaging]][[Category:Qt Mobility]] |
{{Abstract|visible=true|This code example shows how to send an email using the Qt Mobility [http://doc.qt.nokia.com/qtmobility-1.1/messaging.html messaging] API}}. | {{Abstract|visible=true|This code example shows how to send an email using the Qt Mobility [http://doc.qt.nokia.com/qtmobility-1.1/messaging.html messaging] API}}. | ||
Revision as of 08:09, 14 April 2011
This code example shows how to send an email using the Qt Mobility messaging API.
//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);

