Index: composer/e-msg-composer.c
===================================================================
RCS file: /cvs/gnome/evolution/composer/e-msg-composer.c,v
retrieving revision 1.540
diff -u -8 -p -r1.540 e-msg-composer.c
--- composer/e-msg-composer.c	6 Aug 2006 13:59:04 -0000	1.540
+++ composer/e-msg-composer.c	13 Sep 2006 11:52:09 -0000
@@ -343,17 +343,17 @@ get_text (Bonobo_PersistStream persist, 
 	}
 	
 	CORBA_exception_free (&ev);
 	
 	stream_mem = BONOBO_STREAM_MEM (stream);
 	text = g_byte_array_new ();
 	g_byte_array_append (text, stream_mem->buffer, stream_mem->pos);
 	bonobo_object_unref (BONOBO_OBJECT (stream));
-	
+		
 	return text;
 }
 
 #define LINE_LEN 72
 
 static CamelTransferEncoding
 best_encoding (GByteArray *buf, const char *charset)
 {
@@ -5156,16 +5156,49 @@ e_msg_composer_add_inline_image_from_mim
 	
 	location = camel_mime_part_get_content_location (part);
 	if (location) {
 		g_hash_table_insert (p->inline_images_by_url,
 				     g_strdup (location), part);
 	}
 }
 
+/* Stub for helping in printing of mails */
+CamelMimeMessage * e_msg_composer_get_message_print (EMsgComposer *composer, gboolean save_html_object_data)
+{
+	CamelMimeMessage *msg;
+	gboolean old_flags[4];
+	gboolean old_send_html;
+	EMsgComposerPrivate *p = composer->priv;
+	
+	/* create printable mail as HTML */
+	old_send_html = p->send_html;
+	p->send_html = TRUE;
+	old_flags[0] = p->pgp_sign;
+	p->pgp_sign = FALSE;
+	old_flags[1] = p->pgp_encrypt;
+	p->pgp_encrypt = FALSE;
+	old_flags[2] = p->smime_sign;
+	p->smime_sign = FALSE;
+	old_flags[3] = p->smime_encrypt;
+	p->smime_encrypt = FALSE;
+	
+	msg = build_message (composer, TRUE);
+	
+	/* Revert back message's original settings */
+	p->send_html = old_send_html;
+	p->pgp_sign = old_flags[0];
+	p->pgp_encrypt = old_flags[1];
+	p->smime_sign = old_flags[2];
+	p->smime_encrypt = old_flags[3];
+	
+	return msg;
+}
+
+
 
 /**
  * e_msg_composer_get_message:
  * @composer: A message composer widget
  * 
  * Retrieve the message edited by the user as a CamelMimeMessage.  The
  * CamelMimeMessage object is created on the fly; subsequent calls to this
  * function will always create new objects from scratch.
@@ -5177,17 +5210,17 @@ e_msg_composer_get_message (EMsgComposer
 {
 	g_return_val_if_fail (E_IS_MSG_COMPOSER (composer), NULL);
 	if ( e_msg_composer_get_remote_download_count (composer) != 0) {
 		if (!em_utils_prompt_user((GtkWindow *)composer, NULL, "mail-composer:ask-send-message-pending-download", NULL)) {
 			return NULL;
 		}
 	}
 	
-	return build_message (composer, save_html_object_data);
+	return e_msg_composer_get_message_print (composer, save_html_object_data);
 }
 
 CamelMimeMessage *
 e_msg_composer_get_message_draft (EMsgComposer *composer)
 {
 	CamelMimeMessage *msg;
 	EAccount *account;
 	gboolean old_flags[4];
Index: plugins/print-message/print-message.c
===================================================================
RCS file: /cvs/gnome/evolution/plugins/print-message/print-message.c,v
retrieving revision 1.2
diff -u -8 -p -r1.2 print-message.c
--- plugins/print-message/print-message.c	24 Aug 2005 03:14:10 -0000	1.2
+++ plugins/print-message/print-message.c	13 Sep 2006 11:52:09 -0000
@@ -78,17 +78,18 @@ org_gnome_print_message (EPlugin *ep, EM
        	EMsgComposer *composer = (EMsgComposer *)t->target.widget;
 	struct _print_data *data;
 	GtkDialog *dialog;
 	
 	data = g_malloc0(sizeof(*data));
 	data->config = e_print_load_config ();
 	data->preview = 0;
 	
-	data->msg = e_msg_composer_get_message (composer, 1);
+	data->msg = e_msg_composer_get_message_print (composer, 1);
+	
 	dialog = (GtkDialog *)e_print_get_dialog_with_config (_("Print Message"), GNOME_PRINT_DIALOG_COPIES, data->config);
 	gtk_dialog_set_default_response(dialog, GNOME_PRINT_DIALOG_RESPONSE_PRINT);
 	e_dialog_set_transient_for ((GtkWindow *) dialog, (GtkWidget *) composer);
 	g_signal_connect(dialog, "response", G_CALLBACK(print_response), data);
 	gtk_widget_show((GtkWidget *)dialog);
 	
 }
 
@@ -99,14 +100,14 @@ org_gnome_print_preview (EPlugin *ep, EM
 {
   	EMsgComposer *composer = (EMsgComposer *)t->target.widget;
 	struct _print_data *data;
 	
 	data = g_malloc0(sizeof(*data));
 	data->config = e_print_load_config ();
 	data->preview = 0;
 	
-	data->msg = e_msg_composer_get_message (composer, 1);
+	data->msg = e_msg_composer_get_message_print (composer, 1);
 
 	print_response(NULL, GNOME_PRINT_DIALOG_RESPONSE_PREVIEW, data);
 }
 
 
