Action Mailer 在开发模式下不起作用,Rails



嗨,我按照这个轨道广播开发了从我们的网站发送到我们公司指定电子邮件的可能性。

当我编写消息并单击发送时,它不显示任何错误消息。在日志文件中,我可以看到这一点。当我处于生产模式时,它工作得很好。但现在它停留在空中的某个地方。

My Rails 应用程序日志文件 :

Sent mail to mailer@ecotechno.lv (8ms)
Date: Thu, 13 Feb 2014 05:16:57 -0700
To: mailer@ecotechno.lv
Message-ID: <52fcb7b922872_5a0a37b07c53851@just107.justhost.com.mail>
Subject: Welcome email
Mime-Version: 1.0
Content-Type: text/html;
 charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE html>
<html>
  <head>
    <meta content=3D'text/html; charset=3DUTF-8' http-equiv=3D'Content-Ty=
pe' />
  </head>
      <body>
       =
   <h1>Jums nos=C5=ABt=C4=ABta jauna zi=C5=86a no SIA "Ecotechno" m=C4=81=
jaslapas izmantojot kontaktformu</h1>
    =
            =
        <li>S=C5=ABt=C4=ABt=C4=81js: </li>
        <li>Temats:</li>
        <p>Zi=C5=86as teksts: </p>
    =
    </body>
</html>

我的联系表格:

 <%= form_for(@message) do |f| %>                        
    <label for="author">Name:</label>
      <%= text_field_tag 'senders_name', nil, class: 'required input_field' %>
          <div class="cleaner h10"></div>
          <label for="email">Email:</label> 
      <%= text_field_tag 'email', nil, class: 'validate-email required input_field' %>
        <div class="cleaner h10"></div>
                <label for="subject">Subject:</label>
        <%= text_field_tag 'title', nil, class: 'input_field' %>
            <div class="cleaner h10"></div>
                     <label for="text">Message:</label> 
        <%= text_area_tag 'message_text', nil, class: 'required' %>     
                  <div class="cleaner h10"></div>
    <%= submit_tag("Send",:id=>"submit",:class=>"submit_btn float_l") %>
    <input type="reset" value="Reset" id="reset" name="reset" class="submit_btn float_r" />

    <%end%>

我的配置/初始值设定项/setup_mail.rb

ActionMailer::Base.smtp_settings = {
  :address              => "mail.ecotechno.lv",
  :port                 => 26,
  :domain               => "ecotechno.lv",
  :user_name            => "mailer@ecotechno.lv",
  :password             => "mypassw",
  :authentication       => "plain",
  :enable_starttls_auto => true
}

在config/environment/development.rb中,添加以下代码以使用SMTP。 config.action_mailer.delivery_method = :smtp

最新更新