mo_status mo_send_mail_message (char *text, char *to, char *subj, char *content_type, char *url) { FILE *fp; fp = mo_start_sending_mail_message (to, subj, content_type, url); if (!fp) return mo_fail; if(!strcmp(content_type,"url_only")){ fputs(url,fp); fputs("\n\n",fp); } else { fputs (text, fp); } mo_finish_sending_mail_message (); return mo_succeed; }
static XmxCallback (mailhist_win_cb) { mo_window *win = mo_fetch_window_by_id (XmxExtractUniqid ((int)client_data)); char *to, *subj; FILE *fp; switch (XmxExtractToken ((int)client_data)) { case 0: XtUnmanageChild (win->mailhist_win); mo_busy (); to = XmxTextGetString (win->mailhist_to_text); if (!to) return; if (to[0] == '\0') return; subj = XmxTextGetString (win->mailhist_subj_text); /* Open a file descriptor to sendmail. */ fp = mo_start_sending_mail_message (to, subj, "text/x-html", NULL); if (!fp) goto oops; { mo_node *node; fprintf (fp, "<HTML>\n"); fprintf (fp, "<H1>History Path From %s</H1>\n", get_pref_string(eDEFAULT_AUTHOR_NAME)); fprintf (fp, "<DL>\n"); for (node = win->history; node != NULL; node = node->next) { fprintf (fp, "<DT>%s\n<DD><A HREF=\"%s\">%s</A>\n", node->title, node->url, node->url); } fprintf (fp, "</DL>\n"); fprintf (fp, "</HTML>\n"); } mo_finish_sending_mail_message (); oops: free (to); free (subj); mo_not_busy (); break; case 1: XtUnmanageChild (win->mailhist_win); /* Do nothing. */ break; case 2: mo_open_another_window (win, mo_assemble_help_url ("help-on-nested-hotlists.html"), NULL, NULL); break; } return; }