| 118 | } |
| 119 | |
| 120 | bool mail_body::save_to(string& out) const |
| 121 | { |
| 122 | switch (mime_stype_) { |
| 123 | case MIME_STYPE_HTML: |
| 124 | return save_html(html_, hlen_, out); |
| 125 | case MIME_STYPE_PLAIN: |
| 126 | return save_plain(plain_, plen_, out); |
| 127 | case MIME_STYPE_ALTERNATIVE: |
| 128 | return save_alternative(html_, hlen_, plain_, plen_, out); |
| 129 | case MIME_STYPE_RELATED: |
| 130 | acl_assert(attachments_); |
| 131 | return save_relative(html_, hlen_, plain_, plen_, |
| 132 | *attachments_, out); |
| 133 | default: |
| 134 | logger_error("unknown mime_stype: %d", mime_stype_); |
| 135 | return false; |
| 136 | } |
| 137 | } |
| 138 | |
| 139 | void mail_body::set_content_type(const char* content_type) |
| 140 | { |