テキストメーラーにスペースを示していないactionmailerのは、私は、このファイルを送ることになっていますactionmailerのコントローラを持って
Welcome to znood.com, <%= @user.name %>
You have successfully signed up to znood.com,
Your username is: <%= @user.email %>.
To login to the site, just follow this link: <%= @url %>.
Thanks for joining and have a great day!
The Znood Team
[編集済み] これはコントローラのコードである:
def sendmail
@user = User.first
UserMailer.welcome_email(@user).deliver
render "user_mailer/welcome_email.text"
#render the file to see what we're supposed to send
end
これはUserMailer 0内のコードでありますactionmailerの::ベース
def welcome_email(user)
@user = user
@url = "http://znood.com/"
mail(:to => user.email, :subject => "Welcome to Znood!")
end
は、これは私が受けていたメールです:
Welcometoznood.com,AbdoAchkarYouhavesuccessfullysigneduptoznood.com,Yourusernameis:blabla.Tologintothesite,justfollowthislink:http://znood.com/.Thanksforjoiningandhaveagreatday!TheZnoodTeam
をスペース、キャリッジリターンとラインフィードを含めるためにどのように任意の手掛かり?
[編集] letter_openerの宝石をインストールした後、私は私のコンソールで以下を参照してください。
----==_mimepart_4ea9882a2735c_1c782d964bc18193
Date: Thu, 27 Oct 2011 19:34:50 +0300
Mime-Version: 1.0
Content-Type: text/plain;
charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-ID: <[email protected]>
Welcometoznood.com,AbdoAchkarYouhavesuccessfullysigneduptoznood.com,Yourusername
is:blabla.Tologintothesite,justfollowthislink:http://znood.com/.Thanksforjoiningandhaveagreatday!TheZnoodTeam
私は「コンテンツ転送エンコード」のヘッダーを変更しようとしたが、彼らは変更していないようです。私はまた、デフォルト値を設定しようとしました。私たちは7ビットエンコーディングに悩まされているようです。
[編集] 問題を見つける私たちを助けるべきであるもう一つは、私は、ファイルのレンダリングに問題があるかどうかを確認するために、メール機能に次のparamsを渡ししようとしたということです:「!Hellothereを」
mail(:to => user.email, :subject => "Welcome to Znood!") do |format|
#format.text(:content_transfer_encoding => "base64")
format.text { render :text => "Hello there!" }
end
また照合された。
次に、エラーの原因となっているレンダリング機能かメール機能かを確認するために、以下のコードを試してみました。
mail(:to => user.email, :subject => "Welcome to Znood!") do |format|
format.text { "hello there!" }
end
また、照合されました。
ソーステンプレート内のCRLFとは何ですか? –
私は正確には分かりませんが、私たちがスペースの問題に取り組み、それを解決すれば、CRLFの問題も解決します=) – Abdo