Tag: email

如何发送带有rails的电子邮件

这可能是非常直接和简单的,但我是非常新的和轨道上的rubynoob。 我有一个简单的电子邮件PHP脚本,我在旧网站上使用,但现在我已经转换为rails我不知道如何创建等效的那个。 我尝试使用rails generate mailer Notifier ,然后在其中添加了一个发送和发送电子邮件的欢迎方法。 但是在用户控制器中(在创建时,当用户创建帐户时,他们的电子邮件地址被发送了一封欢迎电子邮件)我刚刚收到错误消息,表示Notifier未被声明。 在我的用户控制器中 if @user.save Notifier.welcome(@user).deliver end 这没用

如何使用Rails中的css和图像创建电子邮件?

如何从Rails应用程序创建和发送包含图像和正确格式的电子邮件? 就像你从facebook那里得到的那样。

在生产ROR中通过动作管理器发送邮件的严重问题

我真的需要这方面的帮助,一直试图解决这个问题3天:(我的应用程序应该在收到或发送订单时向客户发送电子邮件,但它会不断突破此错误。 I, [2017-05-23T11:01:44.741054 #1060] INFO — : Completed 500 Internal Server Error in 66ms (ActiveRecord: 4.2ms) F, [2017-05-23T11:01:44.743481 #1060] FATAL — : SocketError (getaddrinfo: Name or service not known): app/admin/order.rb:6:in `block (2 levels) in ‘ 我的动作管理器设置似乎是正确的: config.action_mailer.default_url_options = { host: ‘mypage.com’} config.action_mailer.perform_deliveries = true config.action_mailer.raise_delivery_errors = true config.action_mailer.delivery_method = :smtp config.action_mailer.smtp_settings = { address: ENV[“SMTP_ADDRESS”].inspect, […]

Rails:如何向包含变音符号的收件人发送电子邮件?

我想发送一封包含以下设置的电子邮件 def registration_confirmation(user) recipients user.username + “” from “Netzwerk Muensterland” subject “Vielen Dank für Ihre Registrierung” body :user => user content_type “text/html” end 主题行包含变音符号并且工作正常。 日志说我,它编码如下: =?utf-8?Q?Vielen_Dank_f=C3=BCr_Ihre_Registrierung?= 但是,如果user.username包含变音符号,则电子邮件将不会发送。 我正在使用谷歌应用程序smtp服务器。 如何为收件人完成这样的编码?

通过Gmail发送电子邮件,但配置不同的电子邮件地址

我正在尝试使用GMail的smtp服务器从我的rails应用程序发送电子邮件。 我发送的电子邮件看起来像是从我自己的Gmail地址发送的,而我希望它们来自info@myapp.com。 我使用三种方式身份validation配置了这个东西,我的应用程序有它唯一的密码。 这是我的production.rb config.action_mailer.default_url_options = { host: ‘my ip’, protocol: ‘https’ } config.action_mailer.delivery_method = :smtp config.action_mailer.asset_host = “https://my ip” 这是我的initializers/smtp.rb MyApp::Application.configure do config.action_mailer.smtp_settings = { enable_starttls_auto: “true”, address: “smtp.gmail.com”, port: “587”, domain: “mydomain.com”, authentication: :plain, user_name: ‘myusername@gmail.com’, password: ‘mypassword’ } end 可能吗? 我怎么能这样做?

自定义邮箱标题

我想在我的电子邮件中添加一个查询ID号,这样当用户回复时,ii可以自动将电子邮件附加到查询中。 我要发一条消息请不要在回复时删除这个查询号码,但如果我可以把一个带有查询号码的自定义标题,这样用户就不会看到它会很好。 这是可能的,是否有任何垃圾邮件添加自定义标头? 最好的问候瑞克

如何从ActionMailer发送已签名的电子邮件?

我使用GMail作为我的SMTP服务器。 我的配置工作得很好: # config/initializers/action_mailer.rb: ActionMailer::Base.smtp_settings = { :tls => true, :address => “smtp.gmail.com”, :port => “587”, :domain => “www.example.org”, :authentication => :login, :user_name => “admin@example.org”, :password => “it’s a secret” } 我在config/ssl/rsa.public和config/ssl/rsa.private也有一个公共/私有RSA密钥对。 在将电子邮件发送到GMail的SMTP服务器之前,我该如何签名?

如何从Rails 3中的ActionMailer发送已签名的电子邮件?

使用Rails 3我想使用X.509证书来签署部分电子邮件。 Rails 2目前存在答案, 如何从ActionMailer发送签名的电子邮件? 但它不适用于Rails 3。 是否可以通过Rails 3中的ActionMailer签署电子邮件? 如果无法做到这一点,是否可以在ActionMailer创建后通过sendmail签署电子邮件?

Ruby on Rails-Action邮件没有按照要求?

我有2个模型po和send po:has_many发送 发送:belongs_to po send po send_controller class SendsController < ApplicationController def new @send = Send.new end def create @send = Send.new(params[:send]) if @send.save Pomailer.registration_confirmation(@send).deliver flash[:success] = "Send mail" redirect_to capax_path else flash[:warning] = "mail not send" redirect_to capax_path end end pomailer class Pomailer “xyz@yahoo.co.in”, :subject => ” New purchase order send by ” ) […]

如何设置发送带有邮件gem的HTML电子邮件?

我正在使用Mail gem发送电子邮件。 这是我的代码: require ‘mail’ require ‘net/smtp’ Mail.defaults do delivery_method :smtp, { :address => “smtp.arrakis.es”, :port => 587, :domain => ‘webmail.arrakis.com’, :user_name => ‘myname@domain.com’, :password => ‘pass’, :authentication => ‘plain’, :enable_starttls_auto => true } end Mail::ContentTypeField.new(“text/html”) #this doesnt work msgstr= File.read(‘text2.txt’) list.each do |entity| begin Mail.deliver do from ‘myname@domain.com’ to “#{entity}” subject ‘a good subject’ […]