diff options
author | Dan Winship <danw@src.gnome.org> | 2000-04-28 03:03:54 +0800 |
---|---|---|
committer | Dan Winship <danw@src.gnome.org> | 2000-04-28 03:03:54 +0800 |
commit | 397a851038f09c2a40ac70f8dbf04308622c2c02 (patch) | |
tree | 3ebae9bed4ffc72c9a40764a07b2d545da268d9b /mail/mail-ops.c | |
parent | b9d26cb85f496552e4eb6cbd9834cf33e29e9e95 (diff) | |
download | gsoc2013-evolution-397a851038f09c2a40ac70f8dbf04308622c2c02.tar gsoc2013-evolution-397a851038f09c2a40ac70f8dbf04308622c2c02.tar.gz gsoc2013-evolution-397a851038f09c2a40ac70f8dbf04308622c2c02.tar.bz2 gsoc2013-evolution-397a851038f09c2a40ac70f8dbf04308622c2c02.tar.lz gsoc2013-evolution-397a851038f09c2a40ac70f8dbf04308622c2c02.tar.xz gsoc2013-evolution-397a851038f09c2a40ac70f8dbf04308622c2c02.tar.zst gsoc2013-evolution-397a851038f09c2a40ac70f8dbf04308622c2c02.zip |
Move text_to_html to e-util.
* mail-format.c: Move text_to_html to e-util.
* mail-ops.c (send_to_url): New routine. Thin wrapper for
e_msg_composer_new_from_url.
* mail-display.c (on_link_clicked): print a warning for news or
nntp URLs (which we'll deal with some day), and call send_to_url
for mailto URLs.
svn path=/trunk/; revision=2664
Diffstat (limited to 'mail/mail-ops.c')
-rw-r--r-- | mail/mail-ops.c | 44 |
1 files changed, 36 insertions, 8 deletions
diff --git a/mail/mail-ops.c b/mail/mail-ops.c index 81724c4f43..b339bfd746 100644 --- a/mail/mail-ops.c +++ b/mail/mail-ops.c @@ -258,16 +258,32 @@ static void composer_send_cb (EMsgComposer *composer, gpointer data) { CamelMimeMessage *message; - CamelStream *stream; - int stdout_dup; + CamelTransport *transport; + CamelException *ex; + static gboolean loaded = FALSE; message = e_msg_composer_get_message (composer); - - stdout_dup = dup (1); - stream = camel_stream_fs_new_with_fd (stdout_dup); - camel_data_wrapper_write_to_stream (CAMEL_DATA_WRAPPER (message), - stream); - camel_stream_close (stream); + camel_mime_message_set_from (message, + "Dan Winship <danw@helixcode.com>"); + camel_medium_add_header (CAMEL_MEDIUM (message), "X-Mailer", + "Evolution 0.0.0.0.0.0.0.0.0.1"); + camel_mime_message_set_date (message, CAMEL_MESSAGE_DATE_CURRENT, 0); + + if (!loaded) { + camel_provider_register_as_module ("/usr/local/lib/evolution/camel-providers/0.0.1/libcamelsendmail.so"); + loaded = TRUE; + } + ex = camel_exception_new (); + transport = camel_session_get_transport_for_protocol ( + default_session->session, "sendmail", ex); + if (camel_exception_get_id (ex) != CAMEL_EXCEPTION_NONE) + g_warning (camel_exception_get_description (ex)); + else { + camel_transport_send (transport, CAMEL_MEDIUM (message), ex); + if (camel_exception_get_id (ex) != CAMEL_EXCEPTION_NONE) + g_warning (camel_exception_get_description (ex)); + gtk_object_destroy (GTK_OBJECT (transport)); + } gtk_object_unref (GTK_OBJECT (message)); gtk_object_destroy (GTK_OBJECT (composer)); @@ -286,6 +302,18 @@ send_msg (GtkWidget *widget, gpointer user_data) gtk_widget_show (composer); } +/* Send according to a mailto (RFC 2368) URL. */ +void +send_to_url (const char *url) +{ + GtkWidget *composer; + + composer = e_msg_composer_new_from_url (url); + + gtk_signal_connect (GTK_OBJECT (composer), "send", + GTK_SIGNAL_FUNC (composer_send_cb), NULL); + gtk_widget_show (composer); +} static void reply (FolderBrowser *fb, gboolean to_all) |