# typed: false # DO NOT EDIT MANUALLY # This is an autogenerated file for types exported from the `net-smtp` gem. # Please instead update this file by running `bin/tapioca gem net-smtp`. # == What is This Library? # # This library provides functionality to send internet # mail via SMTP, the Simple Mail Transfer Protocol. For details of # SMTP itself, see [RFC2821] (http://www.ietf.org/rfc/rfc2821.txt). # # == What is This Library NOT? # # This library does NOT provide functions to compose internet mails. # You must create them by yourself. If you want better mail support, # try RubyMail or TMail or search for alternatives in # {RubyGems.org}[https://rubygems.org/] or {The Ruby # Toolbox}[https://www.ruby-toolbox.com/]. # # FYI: the official documentation on internet mail is: [RFC2822] (http://www.ietf.org/rfc/rfc2822.txt). # # == Examples # # === Sending Messages # # You must open a connection to an SMTP server before sending messages. # The first argument is the address of your SMTP server, and the second # argument is the port number. Using SMTP.start with a block is the simplest # way to do this. This way, the SMTP connection is closed automatically # after the block is executed. # # require 'net/smtp' # Net::SMTP.start('your.smtp.server', 25) do |smtp| # # Use the SMTP object smtp only in this block. # end # # Replace 'your.smtp.server' with your SMTP server. Normally # your system manager or internet provider supplies a server # for you. # # Then you can send messages. # # msgstr = < # To: Destination Address # Subject: test message # Date: Sat, 23 Jun 2001 16:26:43 +0900 # Message-Id: # # This is a test message. # END_OF_MESSAGE # # require 'net/smtp' # Net::SMTP.start('your.smtp.server', 25) do |smtp| # smtp.send_message msgstr, # 'your@mail.address', # 'his_address@example.com' # end # # === Closing the Session # # You MUST close the SMTP session after sending messages, by calling # the #finish method: # # # using SMTP#finish # smtp = Net::SMTP.start('your.smtp.server', 25) # smtp.send_message msgstr, 'from@address', 'to@address' # smtp.finish # # You can also use the block form of SMTP.start/SMTP#start. This closes # the SMTP session automatically: # # # using block form of SMTP.start # Net::SMTP.start('your.smtp.server', 25) do |smtp| # smtp.send_message msgstr, 'from@address', 'to@address' # end # # I strongly recommend this scheme. This form is simpler and more robust. # # === HELO domain # # In almost all situations, you must provide a third argument # to SMTP.start/SMTP#start. This is the domain name which you are on # (the host to send mail from). It is called the "HELO domain". # The SMTP server will judge whether it should send or reject # the SMTP session by inspecting the HELO domain. # # Net::SMTP.start('your.smtp.server', 25 # helo: 'mail.from.domain') { |smtp| ... } # # === SMTP Authentication # # The Net::SMTP class supports three authentication schemes; # PLAIN, LOGIN and CRAM MD5. (SMTP Authentication: [RFC2554]) # To use SMTP authentication, pass extra arguments to # SMTP.start/SMTP#start. # # # PLAIN # Net::SMTP.start('your.smtp.server', 25 # user: 'Your Account', secret: 'Your Password', authtype: :plain) # # LOGIN # Net::SMTP.start('your.smtp.server', 25 # user: 'Your Account', secret: 'Your Password', authtype: :login) # # # CRAM MD5 # Net::SMTP.start('your.smtp.server', 25 # user: 'Your Account', secret: 'Your Password', authtype: :cram_md5) # # source://net-smtp-0.3.1/lib/net/smtp.rb:181 class Net::SMTP < ::Net::Protocol # Creates a new Net::SMTP object. # # +address+ is the hostname or ip address of your SMTP # server. +port+ is the port to connect to; it defaults to # port 25. # # If +tls+ is true, enable TLS. The default is false. # If +starttls+ is :always, enable STARTTLS, if +:auto+, use STARTTLS when the server supports it, # if false, disable STARTTLS. # # If +tls_verify+ is true, verify the server's certificate. The default is true. # If the hostname in the server certificate is different from +address+, # it can be specified with +tls_hostname+. # # Additional SSLContext params can be added to +ssl_context_params+ hash argument and are passed to # +OpenSSL::SSL::SSLContext#set_params+ # # +tls_verify: true+ is equivalent to +ssl_context_params: { verify_mode: OpenSSL::SSL::VERIFY_PEER }+. # This method does not open the TCP connection. You can use # SMTP.start instead of SMTP.new if you want to do everything # at once. Otherwise, follow SMTP.new with SMTP#start. # # @return [SMTP] a new instance of SMTP # # source://net-smtp-0.3.1/lib/net/smtp.rb:234 def initialize(address, port = T.unsafe(nil), tls: T.unsafe(nil), starttls: T.unsafe(nil), tls_verify: T.unsafe(nil), tls_hostname: T.unsafe(nil), ssl_context_params: T.unsafe(nil)); end # The address of the SMTP server to connect to. # # source://net-smtp-0.3.1/lib/net/smtp.rb:399 def address; end # source://net-smtp-0.3.1/lib/net/smtp.rb:843 def auth_cram_md5(user, secret); end # source://net-smtp-0.3.1/lib/net/smtp.rb:832 def auth_login(user, secret); end # source://net-smtp-0.3.1/lib/net/smtp.rb:823 def auth_plain(user, secret); end # source://net-smtp-0.3.1/lib/net/smtp.rb:817 def authenticate(user, secret, authtype = T.unsafe(nil)); end # The server capabilities by EHLO response # # source://net-smtp-0.3.1/lib/net/smtp.rb:293 def capabilities; end # true if the EHLO response contains +key+. # # @return [Boolean] # # source://net-smtp-0.3.1/lib/net/smtp.rb:287 def capable?(key); end # Returns supported authentication methods on this server. # You cannot get valid value before opening SMTP session. # # source://net-smtp-0.3.1/lib/net/smtp.rb:322 def capable_auth_types; end # true if server advertises AUTH CRAM-MD5. # You cannot get valid value before opening SMTP session. # # @return [Boolean] # # source://net-smtp-0.3.1/lib/net/smtp.rb:309 def capable_cram_md5_auth?; end # true if server advertises AUTH LOGIN. # You cannot get valid value before opening SMTP session. # # @return [Boolean] # # source://net-smtp-0.3.1/lib/net/smtp.rb:303 def capable_login_auth?; end # true if server advertises AUTH PLAIN. # You cannot get valid value before opening SMTP session. # # @return [Boolean] # # source://net-smtp-0.3.1/lib/net/smtp.rb:297 def capable_plain_auth?; end # true if server advertises STARTTLS. # You cannot get valid value before opening SMTP session. # # @return [Boolean] # # source://net-smtp-0.3.1/lib/net/smtp.rb:282 def capable_starttls?; end # This method sends a message. # If +msgstr+ is given, sends it as a message. # If block is given, yield a message writer stream. # You must write message before the block is closed. # # # Example 1 (by string) # smtp.data(<] # # source://net-smtp-0.3.1/lib/net/smtp.rb:1169 def parameters; end # source://net-smtp-0.3.1/lib/net/smtp.rb:1186 def to_s; end end # This class represents a response received by the SMTP server. Instances # of this class are created by the SMTP class; they should not be directly # created by the user. For more information on SMTP responses, view # {Section 4.2 of RFC 5321}[http://tools.ietf.org/html/rfc5321#section-4.2] # # source://net-smtp-0.3.1/lib/net/smtp.rb:1085 class Net::SMTP::Response # Creates a new instance of the Response class and sets the status and # string attributes # # @return [Response] a new instance of Response # # source://net-smtp-0.3.1/lib/net/smtp.rb:1094 def initialize(status, string); end # Returns a hash of the human readable reply text in the response if it # is multiple lines. It does not return the first line. The key of the # hash is the first word the value of the hash is an array with each word # thereafter being a value in the array # # source://net-smtp-0.3.1/lib/net/smtp.rb:1137 def capabilities; end # Determines whether the response received was a Positive Intermediate # reply (3xx reply code) # # @return [Boolean] # # source://net-smtp-0.3.1/lib/net/smtp.rb:1118 def continue?; end # Creates a CRAM-MD5 challenge. You can view more information on CRAM-MD5 # on Wikipedia: https://en.wikipedia.org/wiki/CRAM-MD5 # # source://net-smtp-0.3.1/lib/net/smtp.rb:1129 def cram_md5_challenge; end # Determines whether there was an error and raises the appropriate error # based on the reply code of the response # # source://net-smtp-0.3.1/lib/net/smtp.rb:1149 def exception_class; end # The first line of the human readable reply text # # source://net-smtp-0.3.1/lib/net/smtp.rb:1123 def message; end # The three digit reply code of the SMTP response # # source://net-smtp-0.3.1/lib/net/smtp.rb:1100 def status; end # Takes the first digit of the reply code to determine the status type # # source://net-smtp-0.3.1/lib/net/smtp.rb:1106 def status_type_char; end # The human readable reply text of the SMTP response # # source://net-smtp-0.3.1/lib/net/smtp.rb:1103 def string; end # Determines whether the response received was a Positive Completion # reply (2xx reply code) # # @return [Boolean] # # source://net-smtp-0.3.1/lib/net/smtp.rb:1112 def success?; end class << self # Parses the received response and separates the reply code and the human # readable reply text # # source://net-smtp-0.3.1/lib/net/smtp.rb:1088 def parse(str); end end end # source://net-smtp-0.3.1/lib/net/smtp.rb:182 Net::SMTP::VERSION = T.let(T.unsafe(nil), String) # source://net-smtp-0.3.1/lib/net/smtp.rb:48 class Net::SMTPAuthenticationError < ::Net::ProtoAuthError include ::Net::SMTPError end # Module mixed in to all SMTP error classes # # source://net-smtp-0.3.1/lib/net/smtp.rb:31 module Net::SMTPError # source://net-smtp-0.3.1/lib/net/smtp.rb:37 def initialize(response, message: T.unsafe(nil)); end # source://net-smtp-0.3.1/lib/net/smtp.rb:42 def message; end # This *class* is a module for backward compatibility. # In later release, this module becomes a class. # # source://net-smtp-0.3.1/lib/net/smtp.rb:35 def response; end end # source://net-smtp-0.3.1/lib/net/smtp.rb:63 class Net::SMTPFatalError < ::Net::ProtoFatalError include ::Net::SMTPError end # source://net-smtp-0.3.1/lib/net/smtp.rb:53 class Net::SMTPServerBusy < ::Net::ProtoServerError include ::Net::SMTPError end # class SMTP # # source://net-smtp-0.3.1/lib/net/smtp.rb:1193 Net::SMTPSession = Net::SMTP # source://net-smtp-0.3.1/lib/net/smtp.rb:58 class Net::SMTPSyntaxError < ::Net::ProtoSyntaxError include ::Net::SMTPError end # source://net-smtp-0.3.1/lib/net/smtp.rb:68 class Net::SMTPUnknownError < ::Net::ProtoUnknownError include ::Net::SMTPError end # source://net-smtp-0.3.1/lib/net/smtp.rb:73 class Net::SMTPUnsupportedCommand < ::Net::ProtocolError include ::Net::SMTPError end