| 52 | } |
| 53 | |
| 54 | static void build_alternative(void) |
| 55 | { |
| 56 | acl::mail_message message("gbk"); |
| 57 | |
| 58 | message.set_from("zsxxsz@263.net", "֣����") |
| 59 | .set_sender("zsx1@263.net") |
| 60 | .set_reply_to("zsx2@263.net") |
| 61 | .add_to("\"֣����1\" <zsx1@sina.com>; \"֣����2\" <zsx2@sina.com>") |
| 62 | .add_cc("\"֣����3\" <zsx1@163.com>; \"֣����4\" <zsx2@163.com>") |
| 63 | .set_subject("���⣺�й��������У�"); |
| 64 | message.add_attachment("main.cpp", "text/plain") |
| 65 | .add_attachment("Makefile", "text/plain"); |
| 66 | |
| 67 | const char* plain = "�й��������� TEXT ��ʽ"; |
| 68 | const char* html = "<html><body><B><font color='red'>�й��������� HTML ��ʽ</font></B></body></html>"; |
| 69 | acl::mail_body body("gbk"); |
| 70 | body.set_alternative(html, strlen(html), plain, strlen(plain)); |
| 71 | message.set_body(body); |
| 72 | |
| 73 | const char* filepath = "./alternative.eml"; |
| 74 | if (message.save_to(filepath) == false) |
| 75 | printf("compose %s error: %s\r\n", filepath, acl::last_serror()); |
| 76 | else |
| 77 | printf("compose %s ok\r\n", filepath); |
| 78 | } |
| 79 | |
| 80 | static void build_relative(void) |
| 81 | { |
no test coverage detected
searching dependent graphs…