2007-06-13 Murray Cumming <murrayc@murrayc.com>
[modest] / tests / dbus_api / test_send_mail.c
1 #include <libmodest-dbus-client/libmodest-dbus-client.h>
2 #include <stdio.h>
3
4 int main(int argc, char *argv[])
5 {
6         /* Initialize maemo application */
7         osso_context_t * osso_context = osso_initialize(
8             "test_hello", "0.0.1", TRUE, NULL);
9                
10         /* Check that initialization was ok */
11         if (osso_context == NULL)
12         {
13                 printf("osso_initialize() failed.\n");
14             return OSSO_ERROR;
15         }
16         
17         /* Call the function in libmodest-dbus-client: */
18         const gboolean ret = libmodest_dbus_client_send_mail (osso_context,
19                 "murrayc@murrayc.com", /* to */
20                 NULL, /* cc */
21                 NULL, /* bcc */
22                 "test subject", /* subject */
23                 "test body\nline two", /* body */
24                 NULL);
25         if (!ret) {
26                         printf("libmodest_dbus_client_call_helloworld() failed.\n");
27                 return OSSO_ERROR;
28         } else {
29                 printf("libmodest_dbus_client_call_helloworld() succeeded.\n");
30         }
31                 
32     /* Exit */
33     return 0;
34 }