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.
Files changed (3) hide show
  1. data/VERSION +1 -1
  2. data/ext/mimetic.cxx +14 -3
  3. metadata +1 -1
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.4
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=utf-8");
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=utf-8");
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=utf-8");
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));
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pony-express
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bharanee Rathna