Browse Source

Add hard-coded MIME headers for text body

tags/v0.1.0
Damien Goutte-Gattat 9 years ago
parent
commit
a27e14a6be
1 changed files with 12 additions and 2 deletions
  1. +12
    -2
      src/fmail.c

+ 12
- 2
src/fmail.c View File

@@ -155,6 +155,16 @@ read_headers(FILE *in, string_buffer_t *headers)
}
}

static void
process_text_body(FILE *in, FILE *out)
{
fprintf(out, "Content-Type: text/plain; charset=\"utf-8\"\r\n"
"Content-Transfer-Encoding: quoted-printable\r\n"
"Content-Disposition: inline\r\n\r\n");
qp_encode_stream(in, out);
fprintf(out, "\r\n");
}


/* Main function. */
@@ -199,10 +209,10 @@ main(int argc, char *argv[])
read_headers(stdin, headers);

/* Write all headers. */
fprintf(stdout, "%s\r\n", sb_get(headers));
fprintf(stdout, "%s", sb_get(headers));

/* Write encoded body. */
qp_encode_stream(stdin, stdout);
process_text_body(stdin, stdout);

return EXIT_SUCCESS;
}

Loading…
Cancel
Save