Hello guys!
Here is my code. My platform is vista.
require ‘action_mailer’
class Gmailer < ActionMailer::Base
def GmailMsg (expe, dest, subj, text, path)
if path != 0
mail.attachments[(path.split(‘\’)[-1])] = File.read(path)
end
mail(:to => dest, :subject => subj, :from => expe, :body => text)
end
end
ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.smtp_settings = { :address => ‘smtp.gmail.com’,
:port => 587,
:domain => ‘gmail.com’,
:authentication => :plain,
:user_name =>
‘@gmail.com’,
:password => '***’}
message = ‘This function works great !’
Gmailer.GmailMsg(‘@gmail.com’,'@gmail.com’,‘function
test’, message, ‘C:\testfile.txt’).deliver
Everything works fine but the console shows a lot of
C:/Ruby192/lib/ruby/1.9.1/net/protocol.rb:305: warning: regexp match
/…/n against to IBM437 string
C:/Ruby192/lib/ruby/1.9.1/net/protocol.rb:305: warning: regexp match
/…/n against to IBM437 string
C:/Ruby192/lib/ruby/1.9.1/net/protocol.rb:305: warning: regexp match
/…/n against to IBM437 string
C:/Ruby192/lib/ruby/1.9.1/net/protocol.rb:305: warning: regexp match
/…/n against to IBM437 string
C:/Ruby192/lib/ruby/1.9.1/net/protocol.rb:305: warning: regexp match
/…/n against to IBM437 string
What I’m doing wrong? How can I get rid of these?
Thank you.