I have an ActionMailer class and a controller that calls it, when I have it
render the email all fields show up like it should send correctly. When I
call AccountMailer.deliver_sent(email) I get SMTPSyntaxError (501 Bad
address syntax) and looking at my log when it happens, anything I pass
through to the deliver_sent(email) is missing, namely the "to:" field.
I
have no idea why it shows up when I do email
MyMailer.create_sent(@user.email_address)
render_text("<pre>"+email.encoded+"</pre>") but
not when I actually send it.
It is driving me nuts and I need it to work for signups on similarthings.com
Here is the code that calls the ActionMailer class:
thanks_email = AccountMailer.create_sent(@user.email)
AccountMailer.deliver_sent(thanks_email)
Here is the ActionMailer class:
class AccountMailer < ActionMailer::Base
def sent(users_email)
@subject = ''Thank you''
@body = {}
@recipients = users_email
@from =
''scott-+eNEF4B5W7x6hJeZ3vmeHwC/G2K4zDHf@public.gmane.org''
@sent_on = Time.now
@headers = {}
end
def subscribe(users_email)
@subject = ''subscribe''
@body = ''subscribe''
@recipients =
''similarthings-discuss-request-cR8azDVoa3LyBKHOHz6TidkoLRlNN4sO@public.gmane.org''
@from = users_email
@sent_on = Time.now
@headers = {}
end
end
Here is my production.rb:
Dependencies.mechanism = :require
ActionController::Base.consider_all_requests_local = false
ActionController::Base.perform_caching = true
If anyone sees something wrong with my config let me know. I am running on
Textdrive which says I do not need any ActionMailer configuration settings
set, default works.
Thanks,
Scott Burton
www.similarthings.com