Fix send emails

This commit is contained in:
Emilio Blanco 2011-03-27 21:28:10 -03:00
parent 231b1e1d1c
commit eff724bdb5
2 changed files with 15 additions and 4 deletions

13
README
View file

@ -17,4 +17,15 @@ Installation
} }
end end
3 Use it 3. Configure SMTP settings
# initializers/smtp_settings.rb
ActionMailer::Base.smtp_settings = {
:address => "mail.example.com.py",
:port => 26,
:authentication => :plain,
:enable_starttls_auto => true,
:user_name => "emilio@example.com.py",
:password => "yourpass"
}
4 Use it

View file

@ -131,7 +131,7 @@ class WebmailController < ApplicationController
def compose def compose
if @mail.nil? if @mail.nil?
operation = operation_param operation = operation_param
if operation == _('Send') if operation == t(:send)
@mail = create_mail @mail = create_mail
encmail = @mail.send_mail encmail = @mail.send_mail
get_imap_session get_imap_session
@ -139,8 +139,8 @@ class WebmailController < ApplicationController
# delete temporary files (attachments) # delete temporary files (attachments)
@mail.delete_attachments() @mail.delete_attachments()
render :action => "webmail/mailsent" render :action => :mailsent
elsif operation == _('Add') elsif operation == t(:add)
@mail = create_mail @mail = create_mail
attachment = CDF::Attachment.new(@mail) attachment = CDF::Attachment.new(@mail)
attachment.file = params['attachment'] attachment.file = params['attachment']