Class: CliApplication::MailLib::Sendmail
- Defined in:
- lib/cli_application/mail_lib/sendmail.rb
Instance Attribute Summary
Attributes inherited from Base
#config_fail_message, #delivery_method
Instance Method Summary collapse
-
#initialize(config, folders) ⇒ Sendmail
constructor
:nodoc:.
-
#sendmail_arguments ⇒ String
Метод возаращает опции ‘sendmail’.
-
#sendmail_location ⇒ String
Метод возвращает путь к скрипту ‘sendmail’.
-
#simple_send(to, name, title, body) ⇒ Boolean
Метод отправки электронного сообщения через sendmail.
Methods inherited from Base
#address, #authentication, #domain, #log_filename, #password, #port, #smpt_log?, #tls?, #user_name, #valid?
Constructor Details
#initialize(config, folders) ⇒ Sendmail
:nodoc:
7 8 9 10 11 12 |
# File 'lib/cli_application/mail_lib/sendmail.rb', line 7 def initialize(config, folders) # :nodoc: @delivery_method = :sendmail super(config, folders) check_config end |
Instance Method Details
#sendmail_arguments ⇒ String
Метод возаращает опции ‘sendmail’
49 50 51 |
# File 'lib/cli_application/mail_lib/sendmail.rb', line 49 def sendmail_arguments @config.sendmail.arguments end |
#sendmail_location ⇒ String
Метод возвращает путь к скрипту ‘sendmail’
42 43 44 |
# File 'lib/cli_application/mail_lib/sendmail.rb', line 42 def sendmail_location @config.sendmail.location end |
#simple_send(to, name, title, body) ⇒ Boolean
Метод отправки электронного сообщения через sendmail
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/cli_application/mail_lib/sendmail.rb', line 21 def simple_send(to, name, title, body) return false unless valid? = CliApplication::MailLib::Message.new .from_email = @config.from .subject = title .body = (@config..nil? || @config. == '') ? body : (body+@config.) processing_to(to, name, ) begin () true rescue Exception => e $stderr.puts "Ошибка отправки письма: #{e.}" false end end |