MCPcopy Create free account
hub / github.com/acl-dev/acl / build_alternative

Function build_alternative

lib_acl_cpp/samples/mime/mail_build/main.cpp:54–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52}
53
54static 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
80static void build_relative(void)
81{

Callers 1

mainFunction · 0.85

Calls 3

set_bodyMethod · 0.80
last_serrorFunction · 0.50
save_toMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…