title: Flask-Mail and Redis Queue library integration giving error
body: <p>I am using Flask-Mail extension to enable mail sending in the app. I was not able to get celery working with flask so I looked up some other library and found <a href="http://python-rq.org/" rel="nofollow">Redis Queue</a>. </p>
  
  <p>Code:</p>
  
  <pre><code>     from flask.ext.mail import Mail,Message
       from rq import Queue
  
       mail = Mail() # mail.init_app(app) is done in top app.py
  
       q = Queue()
  
       @mod.route('/test')
       def m11():
           msg = Message("Signup Successfull",
                    recipients=['abc@gmail.com'])
           msg.body = "Hello there, Welcome!"
           q.enqueue(mail.send, msg)
           return 'done'
  </code></pre>
  
  <p>When I run the code then mail sending is failed in rqworker giving following error:</p>
  
  <pre><code>    17:04:49: *** Listening on default...
      17:06:08: default: flaskext.mail.send(&lt;flaskext.mail.message.Message object at         
                         0x1027a9750&gt;) (8c86f0f9-ae76-4297-bf17-a171a67f1b44)
      17:06:08: 'module' object has no attribute 'send'
      17:06:08: Moving job to failed queue.
  </code></pre>
  
  <p>What can be the reason of this error?</p>
  
  <p>Edit: No attribute send was due to send being an instance method.</p>
  
  <p>There is different problem now. I receive error that Mail object do not have any attribute app. I guess new process of rq does not know about my flask app and hence the error.
  How to solve this problem?</p>