2010-03-23 4 views
0

메일러 작업이 내 애플리케이션에 있고 메일 프로그램이 gmail smtp로 구성되어 있습니다. 응용 프로그램 생성 이메일 주소에서 "이 [email protected]"이 표시 어느 때 다음은 environment.rb에의 파일 내가 구현하려는 생각레일 애플리케이션에서 보낸 사람 주소 사용자 정의

require "smtp_tls" 
ActionMailer::Base.delivery_method = :smtp 
ActionMailer::Base.perform_deliveries = true 
ActionMailer::Base.raise_delivery_errors = true 
ActionMailer::Base.default_charset = "utf-8" 
ActionMailer::Base.default_content_type = "text/html" 

ActionMailer::Base.smtp_settings = { 
:address => "smtp.gmail.com", 
:port => 587, 
:domain => 'gmail.com', 
:user_name => "[email protected]", 
:password => "password", 
:authentication => :plain 

은 아래 내 설정 세부 사항입니다.

보낸 사람 주소를 사용자 지정할 수 있습니다. 다른 장소에서 내가 대신 "[email protected]"

내 메일러 모델과 노력의 주소와 다른 사용하려면 : 개발 서버에서

@from = "#{user.email}" 

가 올바르게 정의 ID를 보여줍니다 로그인합니다. 내 이메일받은 편지함으로 이동하면 보낸 사람 주소가 "[email protected]"으로 표시됩니다.

누구든지이 문제를 해결할 수 있습니까? 미리 감사드립니다.

답변

1

아니요 @from입니다. 방법은 from입니다.

def my_email_sender_method 

    from "nobody <[email protected]>" 
end 
+0

안녕하세요. <[email protected]>을 <# {user.email}>으로 변경할 수 있습니까? 그 자리에 – palani

+0

물론. 당신은 평범한 문자열이나 vars를 원하는대로 설정할 수 있습니다. –

관련 문제