+#include <glib.h>
+#include <glib/gi18n.h>
+#include <gtk/gtkwidget.h>
+
+#include <tny-list.h>
+#include <tny-transport-account.h>
+#include <tny-account-store.h>
+#include <tny-list.h>
+#include <tny-simple-list.h>
+
+#include <modest-runtime.h>
+#include <modest-platform.h>
+#include <modest-init.h>
+
+#include <modest-defs.h>
+#include <modest-tny-account-store.h>
+#include <modest-tny-platform-factory.h>
+#include <modest-mail-operation.h>
+#include <modest-tny-account.h>
+#include <modest-tny-msg.h>
+#include <modest-account-mgr.h>
+#include <modest-account-mgr-helpers.h>
+
+#include <widgets/modest-main-window.h>
+#include <widgets/modest-msg-edit-window.h>
+
+typedef enum {
+ MODEST_ERR_NONE = 0, /* no error */
+ MODEST_ERR_OPTIONS = 1, /* error in the options */
+ MODEST_ERR_CONF = 2, /* error getting confuration db */
+ MODEST_ERR_UI = 3, /* error in the UI */
+ MODEST_ERR_HILDON = 4, /* error with Hildon (maemo-only) */
+ MODEST_ERR_RUN = 5, /* error running */
+ MODEST_ERR_SEND = 6, /* error sending mail */
+ MODEST_ERR_PARAM = 7, /* error in one or more of the parameters */
+ MODEST_ERR_INIT = 8 /* error in initialization */
+} ModestErrorCode;
+
+static gchar* check_account (const gchar *account);
+
+static ModestErrorCode start_ui (const gchar *account,
+ const gchar* mailto, const gchar *cc,
+ const gchar *bcc, const gchar* subject, const gchar *body);
+
+static ModestErrorCode send_mail (const gchar* account,
+ const gchar* mailto, const gchar *cc, const gchar *bcc,
+ const gchar* subject, const gchar *body);