我在非rails应用程序中使用“mail”gem发送电子邮件:
[1] pry(TicketMailer)> mail.body
=> #<Mail::Body:0x00007f6f48823890
@ascii_only=true,
@boundary=nil,
@charset="US-ASCII",
@encoding="7bit",
@epilogue=nil,
@part_sort_order=["text/plain", "text/enriched", "text/html", "multipart/alternative"],
@parts=
[#<Mail::Part:70057967292360, Multipart: false, Headers: <Content-Type: application/pdf; filename="tickets.pdf">, <Content-Transfer-Encoding: binary>, <Content-Disposition: attachment; filename="tickets.pdf">, <Content-ID: <fdsfs343243243432@fdsafdsfds.mail>>>],
@preamble=nil,
@raw_source=
"<!DOCTYPE html>\n<html>\n <head>\n <meta content='text/html; charset=UTF-8' http-equiv='Content-Type' />\n [...........] </body>\n</html>">
[2] pry(TicketMailer)>
调试:
UPDATE user_credits
CROSS JOIN (SELECT SUM(credits) AS total
FROM user_credits)
SET credits = credits + X * credits / total
然而,一封电子邮件带有空身。为什么以及如何解决这个问题?