From: Jamis Buck Date: 2005-07-27T22:41:15+09:00 Subject: Re: ActionMailer NoMethodError 'deliver' On Jul 27, 2005, at 7:01 AM, enspired wrote: > I have created a mailer class ReservationMailer < ActionMailer and > defined a couple of methods on it for confirm and remind. When trying > to send an HTML email I use the dynamic method > ReservationMailer.create_confirm(reservation) and then set the content > type to text/html. The code basically looks like this: > > email = ReservationMailer.create_confirm(reservation) > email.set_content_type("text/html") > ReservationMailer.deliver(email) #this line raises NoMethodError > > I've also tried ReservationMailer::deliver(email) and it raises the > same exception. The message is "undefined method 'deliver'". > > I am developing on Windows XP Professional, Rails 0.13. The way to specify the content type of emails is using the 'content_type' accessor within your "create" method: def confirm(reservation) content_type "text/html" ... end ... ReservationMailer.deliver_confirm(reservation) Unfortunately, documentation for ActionMailer is still sadly lacking, and I apologize for that. I'll do something about that soon. - Jamis