Note that there are some explanatory texts on larger screens.

plurals
  1. PODebugging mail delivery in IronWorker
    text
    copied!<p>I'm trying to use the <code>mail</code> gem to send an email from an IronWorker task. Running the script works on my local system (OS X), but fails when run on IronWorker with the same parameters. I'm new to IronWorker and the <code>mail</code> gem, so I'm at a loss of where to start debugging. Here's the text of the error message.</p> <pre><code>/task/email.rb:5:in `block in &lt;top (required)&gt;': undefined method `[]' for nil:NilClass (NoMethodError) from /task/__gems__/gems/mail-2.4.4/lib/mail/mail.rb:106:in `instance_eval' from /task/__gems__/gems/mail-2.4.4/lib/mail/mail.rb:106:in `defaults' from /task/email.rb:3:in `&lt;top (required)&gt;' from /usr/local/lib/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require' from /usr/local/lib/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require' from __runner__.rb:213:in `&lt;main&gt;' </code></pre> <p>And here's my code:</p> <pre><code>require 'mail' Mail.defaults do delivery_method :smtp, { address: params['address'], port: 587, domain: params['domain'], user_name: params['username'], password: params['password'], authentication: 'plain', enable_starttls_auto: true } end Mail.deliver do to "#{params['to_name']} &lt;#{params['to_address']}&gt;" from "#{params['from_name']} &lt;#{params['from_address']}&gt;" subject "Mail test" text_part do body params['text'] end html_part do content_type 'text/html; charset=UTF-8' body params['html'] end end </code></pre> <p>Note that I was getting this error before locally, but it was caused by using <code>username</code> in the defaults instead of <code>user_name</code>. Any ideas?</p>
 

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