# Actionmailer.receive not creating TMail object

**URL:** <https://www.ruby-forum.com/t/actionmailer-receive-not-creating-tmail-object/129788>\
**Category:** Rails\
**Created:** [February 21, 2008, 4:21pm UTC](https://www.ruby-forum.com/t/actionmailer-receive-not-creating-tmail-object/129788 "2008-02-21T16:21:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![japj](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ecccb3/32.png) [@japj](https://www.ruby-forum.com/u/japj)\
**Post date:** [February 21, 2008, 4:21pm UTC](https://www.ruby-forum.com/t/actionmailer-receive-not-creating-tmail-object/129788/1 "2008-02-21T16:21:17Z")

</div>

Hi,

I am experimenting with receiving email with actionmailer via getmail  
(as described in the Rails Cookbook). The receiving part is working  
like a charm but when I check the class of the email object from  
inside the receive method I get a string instead of a TMail object, as  
I was expecting. Which means I can’t do fancy stuff like  
email.subject. I have no idea what’s wrong. I’m haven’t used  
Actionmailer much, so I might be just misunderstanding something.

Here’s my Actionmailer class:

`
class Importer < ActionMailer::Base
  def self.receive(email)
    logger.info "Received mail #{email.class}"
  end
end
`
