comparison mail.c @ 8:fe6049d23ce5

Adding charset=utf-8
author Adam Chlipala <adam@chlipala.net>
date Thu, 04 Feb 2016 13:01:33 -0500
parents 4a0de889bcec
children 8966edef462a
comparison
equal deleted inserted replaced
7:4a0de889bcec 8:fe6049d23ce5
376 376
377 snprintf(out, sizeof(out), "MIME-Version: 1.0\r\n" 377 snprintf(out, sizeof(out), "MIME-Version: 1.0\r\n"
378 "Content-Type: multipart/alternative; boundary=\"%s\"\r\n" 378 "Content-Type: multipart/alternative; boundary=\"%s\"\r\n"
379 "\r\n" 379 "\r\n"
380 "--%s\r\n" 380 "--%s\r\n"
381 "Content-Type: text/plain\r\n" 381 "Content-Type: text/plain; charset=utf-8\r\n"
382 "\r\n", 382 "\r\n",
383 separator, separator); 383 separator, separator);
384 out[sizeof(out)-1] = 0; 384 out[sizeof(out)-1] = 0;
385 385
386 if (really_string(sock, out) < 0) { 386 if (really_string(sock, out) < 0) {
395 return; 395 return;
396 } 396 }
397 397
398 snprintf(out, sizeof(out), "\r\n" 398 snprintf(out, sizeof(out), "\r\n"
399 "--%s\r\n" 399 "--%s\r\n"
400 "Content-Type: text/html\r\n" 400 "Content-Type: text/html; charset=utf-8\r\n"
401 "\r\n", 401 "\r\n",
402 separator); 402 separator);
403 out[sizeof(out)-1] = 0; 403 out[sizeof(out)-1] = 0;
404 404
405 if (really_string(sock, out) < 0) { 405 if (really_string(sock, out) < 0) {
423 close(sock); 423 close(sock);
424 uw_set_error_message(j->ctx, "Error sending multipart end"); 424 uw_set_error_message(j->ctx, "Error sending multipart end");
425 return; 425 return;
426 } 426 }
427 } else { 427 } else {
428 if (really_string(sock, "Content-Type: text/plain\r\n\r\n") < 0) { 428 if (really_string(sock, "Content-Type: text/plain; charset=utf-8\r\n\r\n") < 0) {
429 close(sock); 429 close(sock);
430 uw_set_error_message(j->ctx, "Error sending text Content-Type"); 430 uw_set_error_message(j->ctx, "Error sending text Content-Type");
431 return; 431 return;
432 } 432 }
433 433