title: Unable to send Mail using smtp relay, Ruby mail gem
body: <p>I'm trying to send an email using the 'mail' gem (packaging using OCRA), but I'm getting an error message: </p>
  
  <pre><code>=== Loading script to check dependencies
  C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.6/lib/mail/check_delivery_params.rb:
  13:in `check_from': SMTP From address may not be blank: nil (ArgumentError)
          from C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.6/lib/mail/check_delive
  ry_params.rb:6:in `check'
          from C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.6/lib/mail/network/deli
  very_methods/smtp.rb:97:in `deliver!'
          from C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.6/lib/mail/message.rb:2
  149:in `do_delivery'
          from C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.6/lib/mail/message.rb:2
  39:in `deliver'
          from C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.6/lib/mail/mail.rb:141:
  in `deliver'
          from c:/BacklogAlert.rb:140:in `send_email'
          from c:/BacklogAlert.rb:163:in `&lt;top (required)&gt;'
          from C:/Ruby23/lib/ruby/gems/2.3.0/gems/ocra-1.3.10/bin/ocra:1211:in `lo
  ad'
          from C:/Ruby23/lib/ruby/gems/2.3.0/gems/ocra-1.3.10/bin/ocra:1211:in `&lt;t
  op (required)&gt;'
          from C:/Ruby23/bin/ocra:22:in `load'
          from C:/Ruby23/bin/ocra:22:in `&lt;main&gt;'
  </code></pre>
  
  <p>The problem is that we're using an internal smtp mail relay which only allows devices to send to internal recipients, so the "from" address isn't needed.</p>
  
  <p>Here's my code: </p>
  
  <pre><code>  Mail.defaults do
        delivery_method :smtp, mail_options
      end
  
      Mail.deliver do
             to email_recipient
           from email_sender
        subject 'Test email ' + today_date
           body 'Attached is a file'
           add_file test_file
         end
  </code></pre>
  
  <p>How do i get the email to send without specifying a "from" address?</p>