A couple of questions:

1) What is the name of your app?  (the bit before .heroku.com)
2) When you say "sending mail from" do you mean the from address?
3) Where are you seeing the 500 error

If you'd like to take this off-list, please submit a support ticket at
http://support.heroku.com so we can help you track down the problem.

- David

On Tue, Dec 8, 2009 at 11:39 AM, lanceball <lanceb...@gmail.com> wrote:

> Hi there
>
> I'm using the sendgrid basic addon and I'm a little stumped.  I get a
> 500 error when sending mail from my custom domain, but not from
> myapp.heroku.com.
>
> My mailer is very simple - an observer that sends out email on save of
> an AR object.  And like I said, everything works just fine when I'm
> navigating the app using the myapp.heroku.com domain.
>
> I've set config.action_mailer.raise_delivery_errors = true in
> production.rb
>
> But heroku logs show me nothing.  Here's what I see in the logs after
> a restart of the app and then a test resulting in the 500 error.
>
> Otherland:$ heroku logs
> ==> production.log <==
> # Logfile created on Tue Dec 08 08:24:18 -0800 2009
> ==> dyno-455072.log <==
> Otherland:$
>
> If I use the heroku console to create the AR object mail is sent just
> fine.  Here's what that looks like:
>
> >> Contact.inspect
> => "Contact(id: integer, name: string, email: string, message: text,
> created_at: datetime, updated_at: datetime)"
> >> Contact.create!(:name=>'foo', :email=>'f...@bar.com', message=>'hello
> world')
> NameError: undefined local variable or method `message' for #<Object:
> 0x2b6a4f52a348 @heroku_console_output=[]>
> >> Contact.create!(:name=>'foo', :email=>'f...@bar.com', :message=>'hello
> world')
> => #<Contact id: 6, name: "foo", email: "f...@bar.com", message: "hello
> world", created_at: "2009-12-08 16:28:44", updated_at: "2009-12-08
> 16:28:44">
> >>
>
> My controller is pretty basic...
>
> class ContactsController < ApplicationController
>  def create
>    @contact = Contact.create!(params[:contact])
>    flash[:info] = 'Your message has been sent. Thanks!'
>    redirect_to contact_path(@contact)
>  end
> end
>
> My observer:
>
> class ContactObserver < ActiveRecord::Observer
>  def after_create(contact)
>    ContactMailer.deliver_contact_message(contact)
>    contact.logger.info("Contact from #{contact.name} sent")
>  end
> end
>
> My mailer:
>
> class ContactMailer < ActionMailer::Base
>  def contact_message(contact)
>    recipients 'aliciac...@yahoo.com'
>    bcc 'la...@shovelpunks.com'
>    subject "New aliciachatham.com Message from #{contact.name}"
>    from 'mai...@aliciachatham.com'
>    body :contact=>contact
>  end
> end
>
>
> This is all Rails 101 stuff, so I'm baffled as to why it's not
> working.  Can anyone point me in the right direction?  I'm at a bit of
> a loss at this point.
>
> Thanks,
> Lance
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Heroku" group.
> To post to this group, send email to her...@googlegroups.com.
> To unsubscribe from this group, send email to
> heroku+unsubscr...@googlegroups.com<heroku%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/heroku?hl=en.
>
>
>

--

You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to her...@googlegroups.com.
To unsubscribe from this group, send email to 
heroku+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.


Reply via email to