阅读623 返回首页    go 手机大全


SMTP之Ruby调用示例__SMTP接口说明_邮件推送-阿里云

# install `mail` gem first: `gem install mail`

require 'mail'

Mail.defaults do
  delivery_method :smtp, {
    :port      => 25,
    :address   => "smtpdm.aliyun.com",
    :user_name => "domaintest@dm.aliyun.com",
    :password  => "****",
    :enable_starttls_auto => false, 
    :openssl_verify_mode => 'none',
  }
end

mail = Mail.deliver do
  to      'test@test.com'
  from    'domaintest@dm.aliyun.com'
  subject 'Hello'

  text_part do
    body 'Testing mail'
  end
end

注:请在 :user_name => 后替换您的邮件推送地址;:password => 后替换您的邮件推送密码;to '后替换接收地址;from '后替换邮件推送地址

最后更新:2016-11-24 11:23:48

  上一篇:go SMTP之perl调用示例__SMTP接口说明_邮件推送-阿里云
  下一篇:go SMTP之nodejs调用示例__SMTP接口说明_邮件推送-阿里云