Tag: Rails/メール送信

目次

関連ページ

参考情報

概要

基本的な使用方法

設定ファイルの変更

外部のsmtpサーバーを使って認証してから送信する例

  config.action_mailer.raise_delivery_errors = true
  config.action_mailer.default_url_options = { :host => "localhost", :port => 3000 }
  config.action_mailer.delivery_method = :smtp
  config.action_mailer.smtp_settings = {
    :address => "my.smtp.com,
    :port => 587,
    :user_name => "tanaka@my.smtp.com",
    :password => "smptpass",
    :authentication => 'plain',
    :enable_starttls_auto => false,
  }

ローカルでsmtpサーバーが動いている場合

  config.action_mailer.raise_delivery_errors = true
  config.action_mailer.default_url_options = { :host => "localhost", :port => 3000 }
  config.action_mailer.delivery_method = :smtp

ファイル生成

user_mailer.rbを編集する

hello.text.erbの作成

送信する


トップ   編集 凍結 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2022-04-11 (月) 15:28:16