File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -245,12 +245,13 @@ fn (mut c Client) send_body(cfg Mail) ? {
245
245
}
246
246
247
247
if is_html {
248
- sb.write_string ('Content-Type: text/html; charset=UTF-8' )
248
+ sb.write_string ('Content-Type: text/html; charset=UTF-8\r\n ' )
249
249
} else {
250
- sb.write_string ('Content-Type: text/plain; charset=UTF-8' )
250
+ sb.write_string ('Content-Type: text/plain; charset=UTF-8\r\n ' )
251
251
}
252
+ sb.write_string ('Content-Transfer-Encoding: base64' )
252
253
sb.write_string ('\r\n\r\n ' )
253
- sb.write_string (cfg.body)
254
+ sb.write_string (base 64 . encode_str ( cfg.body) )
254
255
sb.write_string ('\r\n .\r\n ' )
255
256
c.send_str (sb.str ())?
256
257
c.expect_reply (.action_ok)?
Original file line number Diff line number Diff line change @@ -131,3 +131,11 @@ fn test_smtp_multiple_recipients() ? {
131
131
132
132
assert true
133
133
}
134
+
135
+ fn test_smtp_body_base64encode () ? {
136
+ $if ! network ? {
137
+ return
138
+ }
139
+
140
+ assert true
141
+ }
You can’t perform that action at this time.
0 commit comments