-// modest_tny_transport_actions_send_message (transport_account,
-// from, to, cc, bcc,
-// subject, *body, NULL);
+ /* FIXME: Code added just for testing. The transport_account
+ should be provided by the account manager, maybe using
+ _get_current_account () or _get_default_account
+ (TRANSPORT_ACCOUNT). These methods do not exist currently. */
+ {
+ TnyList *accounts;
+ TnyIterator *iter;
+ TnyAccountStore *account_store;
+
+ accounts = TNY_LIST(tny_simple_list_new ());
+ account_store = tny_platform_factory_new_account_store (priv->fact);
+ tny_account_store_get_accounts (account_store, accounts,
+ TNY_ACCOUNT_STORE_TRANSPORT_ACCOUNTS);
+
+ iter = tny_list_create_iterator(accounts);
+ tny_iterator_first (iter);
+ if (tny_iterator_is_done (iter)) {
+ /* FIXME: Add error handling through mail operation */
+ g_printerr("modest: no transport accounts defined\n");
+ g_free (body);
+ return;
+ }
+ transport_account = TNY_TRANSPORT_ACCOUNT (tny_iterator_get_current(iter));
+ }
+
+ mail_operation = modest_mail_operation_new ();
+
+ modest_mail_operation_send_new_mail (mail_operation,
+ transport_account,
+ from, to, cc, bcc,
+ subject, body, NULL);
+ /* Clean up */
+ g_object_unref (mail_operation);
+ g_free (from);