title: Error "end of file reached (EOFError)" when connecting SMTP to send an email with Ruby/Mail
body: <p>I try to connect an email server and send an email.
  I am getting the error below.</p>
  <p>I checked many posts in StackOverflow and I can't find the real reason behind this:</p>
  <pre class="lang-bash prettyprint-override"><code>/home/leandro/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/net/protocol.rb:227:in `rbuf_fill': end of file reached (EOFError)
      from /home/leandro/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/net/protocol.rb:193:in `readuntil'
      from /home/leandro/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/net/protocol.rb:203:in `readline'
      from /home/leandro/.rvm/rubies/ruby-3.1.2/lib/ruby/gems/3.1.0/gems/net-smtp-0.3.1/lib/net/smtp.rb:1040:in `recv_response'
      from /home/leandro/.rvm/rubies/ruby-3.1.2/lib/ruby/gems/3.1.0/gems/net-smtp-0.3.1/lib/net/smtp.rb:642:in `block in do_start'
      from /home/leandro/.rvm/rubies/ruby-3.1.2/lib/ruby/gems/3.1.0/gems/net-smtp-0.3.1/lib/net/smtp.rb:1050:in `critical'
      from /home/leandro/.rvm/rubies/ruby-3.1.2/lib/ruby/gems/3.1.0/gems/net-smtp-0.3.1/lib/net/smtp.rb:642:in `do_start'
      from /home/leandro/.rvm/rubies/ruby-3.1.2/lib/ruby/gems/3.1.0/gems/net-smtp-0.3.1/lib/net/smtp.rb:604:in `start'
      from /home/leandro/.rvm/gems/ruby-3.1.2/gems/mail-2.7.1/lib/mail/network/delivery_methods/smtp.rb:109:in `start_smtp_session'
      from /home/leandro/.rvm/gems/ruby-3.1.2/gems/mail-2.7.1/lib/mail/network/delivery_methods/smtp.rb:100:in `deliver!'
      from /home/leandro/.rvm/gems/ruby-3.1.2/gems/mail-2.7.1/lib/mail/message.rb:2159:in `do_delivery'
      from /home/leandro/.rvm/gems/ruby-3.1.2/gems/mail-2.7.1/lib/mail/message.rb:262:in `deliver'
      from smtp.rb:27:in `&lt;main&gt;'
  </code></pre>
  <p>Here is the source code:</p>
  <pre class="lang-rb prettyprint-override"><code>require 'mail'
  
  options = { 
      :address                =&gt; '104.***.**.79',
      :port                   =&gt; 25,
      :user_name              =&gt; 'postfixuser',
      :password               =&gt; 'Sa*****',
      :authentication         =&gt; 'plain',
      :enable_starttls_auto   =&gt; false, 
      :openssl_verify_mode    =&gt; OpenSSL::SSL::VERIFY_NONE
  }
  
  Mail.defaults do
      delivery_method :smtp, options
  end
  
  mail = Mail.new do
      to &quot;a &lt;postfixuser@fabulousfunfacts.site&gt;&quot;
      #message_id the_message_id # use this for
      from &quot;b &lt;root@fabulousfunfacts.site&gt;&quot;
      #reply_to reply_to_email.nil? ? BlackStack::Emails::from_email : reply_to_email
      subject &quot;Test&quot;
      body &quot;Test&quot;
  end # Mail.new
  
  # deliver the email
  mail.deliver
  </code></pre>