pony-express 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/ext/mimetic.cxx +14 -3
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.5
|
data/ext/mimetic.cxx
CHANGED
@@ -20,6 +20,7 @@ using namespace mimetic;
|
|
20
20
|
|
21
21
|
VALUE rb_mimetic_build(VALUE self, VALUE options) {
|
22
22
|
ostringstream output;
|
23
|
+
int message_id = 1;
|
23
24
|
|
24
25
|
VALUE text = rb_hash_aref(options, ID2SYM(rb_intern("text")));
|
25
26
|
VALUE html = rb_hash_aref(options, ID2SYM(rb_intern("html")));
|
@@ -36,6 +37,7 @@ VALUE rb_mimetic_build(VALUE self, VALUE options) {
|
|
36
37
|
MimeEntity *message = NULL;
|
37
38
|
MimeEntity *html_part = NULL;
|
38
39
|
MimeEntity *text_part = NULL;
|
40
|
+
MimeVersion v1("1.0");
|
39
41
|
|
40
42
|
try {
|
41
43
|
message = new MimeEntity;
|
@@ -46,14 +48,23 @@ VALUE rb_mimetic_build(VALUE self, VALUE options) {
|
|
46
48
|
text_part = new MimeEntity;
|
47
49
|
message->body().parts().push_back(text_part);
|
48
50
|
message->body().parts().push_back(html_part);
|
49
|
-
text_part->header().contentType("text/plain; charset=
|
51
|
+
text_part->header().contentType("text/plain; charset=UTF-8");
|
52
|
+
text_part->header().contentTransferEncoding("8bit");
|
53
|
+
text_part->header().messageid(message_id++);
|
54
|
+
text_part->header().mimeVersion(v1);
|
50
55
|
text_part->body().assign(RSTRING_PTR(text));
|
51
|
-
html_part->header().contentType("text/html; charset=
|
56
|
+
html_part->header().contentType("text/html; charset=UTF-8");
|
57
|
+
html_part->header().contentTransferEncoding("7bit");
|
58
|
+
html_part->header().messageid(message_id++);
|
59
|
+
html_part->header().mimeVersion(v1);
|
52
60
|
html_part->body().assign(RSTRING_PTR(html));
|
53
61
|
}
|
54
62
|
else {
|
55
63
|
message->body().assign(RSTRING_PTR(text));
|
56
|
-
message->header().contentType("text/plain; charset=
|
64
|
+
message->header().contentType("text/plain; charset=UTF-8");
|
65
|
+
message->header().contentTransferEncoding("8bit");
|
66
|
+
message->header().messageid(message_id++);
|
67
|
+
message->header().mimeVersion(v1);
|
57
68
|
}
|
58
69
|
|
59
70
|
message->header().from(RSTRING_PTR(from));
|