2014-02-13 71 views
2

嗨我跟着this railcast發展posibility從我們的網站發送消息到我們公司指定的電子郵件。行動梅勒不工作在開發模式,Rails

當我編寫消息並單擊發送時,它不顯示任何錯誤消息。在日誌文件中,我可以看到這一點。當我處於生產模式時,它工作得很好。但現在它在某個地方被空中阻塞了。

我的Rails應用程序日誌文件:

Sent mail to [email protected] (8ms) 
Date: Thu, 13 Feb 2014 05:16:57 -0700 
To: [email protected] 
Message-ID: <[email protected]> 
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   => "[email protected]", 
    :password    => "mypassw", 
    :authentication  => "plain", 
    :enable_starttls_auto => true 
} 
+1

您是否在您的郵件文件中添加了默認值:「[email protected]」 –

+0

@RahulSingh是的,我現在做了,沒有改變。 – Edgars

回答

1

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

+0

我現在做了,沒有改變! – Edgars