텍스트 메일러에 공백이 표시되지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의 코드 123,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
모든 단서는 어떻게 공백, 캐리지 리턴을 포함하는 라인 피드? 나는 "콘텐츠 전송 인코딩"헤더를 변경하려고
----==_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
하지만 그들은 변경하지 않는 것 :
[편집] 는 letter_opener 보석을 설치 한 후, 나는 내 콘솔에서 다음을 참조하십시오. 또한 기본값을 설정하려고했습니다. 우리가 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