Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/65.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails Rails、事务性电子邮件和发件人验证_Ruby On Rails_Sendinblue - Fatal编程技术网

Ruby on rails Rails、事务性电子邮件和发件人验证

Ruby on rails Rails、事务性电子邮件和发件人验证,ruby-on-rails,sendinblue,Ruby On Rails,Sendinblue,我想使用Sendinblue从Rails web应用程序发送事务性电子邮件。 要将我的应用程序配置为使用Sendinblue,我编辑了config/environments/production.rb,如下所示注意:fireworks.com只是一个示例: Rails.application.configure do ... config.action_mailer.raise_delivery_errors = true config.action_mailer.delivery_

我想使用Sendinblue从Rails web应用程序发送事务性电子邮件。 要将我的应用程序配置为使用Sendinblue,我编辑了config/environments/production.rb,如下所示注意:fireworks.com只是一个示例:

Rails.application.configure do
  ...
  config.action_mailer.raise_delivery_errors = true
  config.action_mailer.delivery_method = :smtp
  host = 'fireworks.com'
  config.action_mailer.default_url_options = { host: host }
  ActionMailer::Base.smtp_settings = {
    :address        => 'smtp-relay.sendinblue.com',
    :port           => '587',
    :authentication => :plain,
    :user_name      => ENV['SENDINBLUE_USERNAME'],
    :password       => ENV['SENDINBLUE_PASSWORD'],
    :domain         => 'fireworks.com',
    :enable_starttls_auto => true
  }
  ...
end
我需要任何gem吗,比如sib-api-v3-sdk? 我想这个gem只对使用Sendinblue API发送电子邮件有用

在Sendinblue,我验证了我的域名“fireworks.com”,并创建了一个发件人,noreply@fireworks.com,我将使用它激活帐户

为了让我使用此发件人,Sendinblue希望我验证或验证它。 关键是noreply@fireworks.com不存在。Michael Hartl在他的教程中使用noreply@example.com,我会用noreply@fireworks.com因为我拥有fireworks.com域名。 由于我无法验证发件人,我认为唯一的解决方案是在我的服务器中创建noreply用户帐户,配置Postfix以接收来自Internet的电子邮件,并将MX记录添加到我的DNS区域。 在收到验证电子邮件之前,我将保持此配置。 这个解决方案有必要吗?我还有别的选择吗

关键是noreply@fireworks.com不存在

在继续之前,我想指出,这最终不是一个好的做法。你需要一些地址来接收和识别弹跳

话虽如此,我只是查看了他们的文档,文档中说,您可以通过DNS条目、文件上传或向他们发送电子邮件来验证整个域,而不是验证单个电子邮件地址

app/mailers/application_mailer.rb

class ApplicationMailer < ActionMailer::Base
  default from: "noreply@fireworks.com"
  layout 'mailer'
end