通过 ‘net/smtp’ 标准库发送email
1 | require 'net/smtp' |
主要 message 的格式,一个电子邮件要要From,To和Subject,文本内容与头部信息间需要一个空行
通过 第三方 gem 包的方式
1 | gem install mail |
1 | require 'mail' |
通过单独使用 rails 的 action mailer 组件的方式
1 | require 'action_mailer' |
http://www.runoob.com/ruby/ruby-sending-email.html
https://github.com/mikel/mail/
https://github.com/rails/rails/tree/v5.2.1.1/actionmailer
https://ruby-china.github.io/rails-guides/action_mailer_basics.html