Rendering of MIME parts

mailmime_fields_write, mailmime_content_write and mailmime_content_type_write

#include <libetpan/libetpan.h>

int mailmime_fields_write(FILE * f, int * col,
			  struct mailmime_fields * fields);

int mailmime_content_write(FILE * f, int * col,
			   struct mailmime_content * content);

int mailmime_content_type_write(FILE * f, int * col,
				struct mailmime_content * content);
        

mailmime_fields_write render the MIME header fields.

mailmime_content_write render the MIME content type header field.

mailmime_content_write render the content of the MIME content type header field.

Example 4-33. rendering MIME header fields

#include <libetpan/libetpan.h>

int main(int argc, char ** argv)
{
  struct mailmime_mime * mime_fields;
  int col;

  /* look at the example in mailmime_fields to see how to
     build a mailmime_fields */
  mime_fields = build_mime_fields();

  col = 0;
  mailmime_fields_write(stdout, &col, mime_fields);

  mailmime_fields_free(mime_fields);
}

int main(int argc, char ** argv)
{
  struct mailmime_content * content;
  int col;

  /* look at the example in mailmime_content to see how to
     build a mailmime_fields */
  content = build_mime_content();

  col = 0;
  mailmime_content_write(stdout, &col, mime_fields);

  mailmime_content_free(content);
}

int main(int argc, char ** argv)
{
  struct mailmime_content * content;
  int col;

  /* look at the example in mailmime_content to see how to
     build a mailmime_fields */
  content = build_mime_content();

  col = 0;
  mailmime_content_type_write(stdout, &col, mime_fields);

  mailmime_content_free(content);
}
          

mailmime_write

#include <libetpan/libetpan.h>

int mailmime_write(FILE * f, int * col,
		   struct mailmime * build_info);
        

This function will render a MIME message.

mailmime_quoted_printable_write and mailmime_base64_write

#include <libetpan/libetpan.h>

int mailmime_quoted_printable_write(FILE * f, int * col, int istext,
    const char * text, size_t size);

int mailmime_base64_write(FILE * f, int * col,
    const char * text, size_t size);
        

mailmime_quoted_printable_write() will render a string to quoted printable.

mailmime_base64_write() will render a string to base64.

Example 4-34. render base64 or quoted printable

#include <libetpan/libetpan.h>

int main(int argc, char ** argv)
{
  int col;

  col = 0;
  mailmime_quoted_printable_write(stdout, &col,
    "this is a test", 14);
}

#include <libetpan/libetpan.h>

int main(int argc, char ** argv)
{
  int col;

  col = 0;
  mailmime_base64_write(stdout, &col, "this is a test", 14);
}
          

mailmime_data_write

#include <libetpan/libetpan.h>

int mailmime_data_write(FILE * f, int * col,
    struct mailmime_data * data,
    int istext);
        

mailmime_data_write will render MIME data.