Note that there are some explanatory texts on larger screens.

plurals
  1. POCannot call method `start_tls` when using Net::SMTP
    primarykey
    data
    text
    <p>I have the following code:</p> <pre><code>require 'net/smtp' #This method prints the method "starttls" p Net::SMTP.instance_methods #And here I get an error of unknown method Net::SMTP.starttls Net::SMTP.start('smtp.gmail.com', 587, 'mypassword') do |smtp| smtp.open_message_stream('from@example.com', ['to@example.com']) do |f| f.puts 'From: from@example.com' f.puts 'To: to@example.com' f.puts 'Subject: My Subject!' f.puts 'Test subject.' end </code></pre> <p>After showing that the method starttls is available in the list of instance methods of Net::SMTP.instance_methods I get the following error:</p> <pre><code>["starttls", "ready", "enable_starttls", "ssl?", "open_timeout", "capable_cram_md5_auth?", "tls?", "capable_plain_auth?", "data", "inspect", "disable_starttls", "rcptto", "starttls_auto?", "mailfrom", "open_timeout=", "capable_auth_types", "auth_cram_md5", "authenticate", "quit", "send_message", "rcptto_list", "set_debug_output", "esmtp=", "starttls?", "esmtp", "auth_plain", "debug_output=", "starttls_always?", "auth_login", "started?", "read_timeout", "capable_starttls?", "enable_tls", "finish", "open_message_stream", "enable_starttls_auto", "send_mail", "start", "address", "port", "sendmail", "esmtp?", "disable_tls", "helo", "read_timeout=", "disable_ssl", "capable_login_auth?", "ehlo", "enable_ssl", "handle_different_imports", "include_class", "java_kind_of?", "java_signature", "methods", "freeze", "extend", "==", "nil?", "object_id", "method", "tainted?", "is_a?", "instance_variable_get", "instance_variable_defined?", "instance_variable_set", "hash", "display", "send", "private_methods", "enum_for", "equal?", "com", "to_java", "type", "instance_of?", "id", "taint", "class", "java_annotation", "instance_variables", "to_s", "org", "to_a", "__send__", "=~", "protected_methods", "__id__", "java_implements", "tap", "frozen?", "java", "respond_to?", "instance_eval", "===", "java_package", "untaint", "clone", "java_name", "to_enum", "singleton_methods", "eql?", "instance_exec", "dup", "kind_of?", "java_require", "javax", "public_methods"] NoMethodError: undefined method `starttls' for Net::SMTP:Class </code></pre> <p>Thoughts?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload