Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9232891
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:25:16+00:00 2026-06-18T06:25:16+00:00

My app has a contact page where users can input their name/email/subject/content and send

  • 0

My app has a contact page where users can input their name/email/subject/content and send me a message. I’m using the Sendgrid addon to heroku and think I’ve done almost everything right. I’ve got this in my

emails_controller.rb

if @email.save
  ContactMailer.contact_message(@email).deliver
  flash.now[:success] = "Your email has sent! I'll try to get back to you shortly."
  render :new
else
  flash.now[:error] = "Please correct the highlighted errors and try again."
  render :new
end

(the idea here is to keep a record of each email and also send it to me).

My config/initializers/mail.rb

# SendGrid Settings
ActionMailer::Base.smtp_settings = {
  :address        => 'smtp.sendgrid.net',
  :port           => '587',
  :authentication => :plain,
  :enable_starttls_auto => true,
  :user_name      => ENV['SENDGRID_USERNAME'],
  :password       => ENV['SENDGRID_PASSWORD'],
  :domain         => 'myappname.com'
}
ActionMailer::Base.delivery_method = :smtp

Then, for good measure, following what someone else did in a sendgrid support question. config/environments/production.rb:

config.action_mailer.default_url_options = { :host => 'myappname.com' }

My contact_email.html.erb:

class Contact < ActionMailer::Base
  default from: "unimportant@example.com"

  def contact_message(email)
    @name = email.name
    @address = email.address
    @subject = email.subject
    @content = email.content
    mail(:to => ENV['EMAIL_ADDRESS'], :subject => @subject)
  end

end

I added all the necessary environmental variables through

heroku config:add EMAIL_ADDRESS=blah@blah.com
heroku config:add SENDGRID_USERNAME=blah

When I push to heroku and try to send myself an email, though, it gives me the “We’re sorry. Something went wrong” screen of death, and the logs are (to my eyes) totally useless.

Here’s the log starting from when I last pushed to heroku and tried to send myself an email. Any ideas what’s possibly going wrong?

2013-02-03T20:34:18+00:00 heroku[router]: at=info method=GET path=/ host=<appname>-2591.herokuapp.com fwd=69.181.104.85 dyno=web.1 queue=0 wait=0ms connect=7ms service=201ms status=304 bytes=0
2013-02-03T20:34:18+00:00 heroku[router]: at=info method=GET path=/assets/application-cd9c41b78562d03bb04bcaaa585b31e8.js host=<appname>-2591.herokuapp.com fwd=69.181.104.85 dyno=web.1 queue=0 wait=0ms connect=1ms service=11ms status=200 bytes=125507
2013-02-03T20:34:19+00:00 heroku[router]: at=info method=GET path=/assets/pig3-b2d5155bd2811a87cafec6a447459580.png host=<appname>-2591.herokuapp.com fwd=69.181.104.85 dyno=web.1 queue=0 wait=0ms connect=1ms service=4ms status=200 bytes=3010
2013-02-03T20:34:19+00:00 heroku[router]: at=info method=GET path=/assets/github-e8c3b3f49b0cc737afe9b3cd6e9ab159.png host=<appname>-2591.herokuapp.com fwd=69.181.104.85 dyno=web.1 queue=0 wait=0ms connect=1ms service=4ms status=200 bytes=3687
2013-02-03T20:34:19+00:00 heroku[router]: at=info method=GET path=/assets/odesk2-38dadc2e6b0e94aa6c6766df301716bc.png host=<appname>-2591.herokuapp.com fwd=69.181.104.85 dyno=web.1 queue=0 wait=1ms connect=2ms service=4ms status=200 bytes=3932
2013-02-03T20:34:19+00:00 heroku[router]: at=info method=GET path=/assets/star-02718a47b29575c2d7a0e75ac8bebf4d.png host=<appname>-2591.herokuapp.com fwd=69.181.104.85 dyno=web.1 queue=0 wait=0ms connect=2ms service=4ms status=200 bytes=3104
2013-02-03T20:34:19+00:00 heroku[router]: at=info method=GET path=/assets/empty_star-9bf002077eafec40cf239068f7d4d1ca.png host=<appname>-2591.herokuapp.com fwd=69.181.104.85 dyno=web.1 queue=0 wait=0ms connect=1ms service=43ms status=200 bytes=3072
2013-02-03T20:34:23+00:00 heroku[router]: at=info method=GET path=/emails/new host=<appname>-2591.herokuapp.com fwd=69.181.104.85 dyno=web.1 queue=0 wait=0ms connect=1ms service=119ms status=200 bytes=3022
2013-02-03T20:34:23+00:00 heroku[router]: at=info method=GET path=/assets/application-74fd2354261a1131b26861b47bef1d87.css host=<appname>-2591.herokuapp.com fwd=69.181.104.85 dyno=web.1 queue=0 wait=0ms connect=2ms service=4ms status=304 bytes=0
2013-02-03T20:34:19+00:00 heroku[router]: at=info method=GET path=/assets/headshot-767c8913c7af4fc97cb8e15881884f0e.png host=<appname>-2591.herokuapp.com fwd=69.181.104.85 dyno=web.1 queue=0 wait=4ms connect=6ms service=11ms status=200 bytes=146892
2013-02-03T20:34:39+00:00 heroku[router]: at=info method=POST path=/emails host=<appname>-2591.herokuapp.com fwd=69.181.104.85 dyno=web.1 queue=0 wait=0ms connect=7ms service=131ms status=500 bytes=643
2013-02-03T20:34:39+00:00 heroku[router]: at=info method=GET path=/favicon.ico host=<appname>-2591.herokuapp.com fwd=69.181.104.85 dyno=web.1 queue=0 wait=1ms connect=3ms service=5ms status=200 bytes=0

Also, I DID add Sendgrid (followed Heroku’s instructions), and the Sendgrid user interface shows no emails sent. And the last time I tried this, the following line seemed to be the only one in the heroku logs that was relevantly timestamped when I tried to send another message. Not very helpful:

2013-02-04T18:15:45+00:00 heroku[router]: at=info method=GET path=/contact host=myappname.com fwd=69.181.104.85 dyno=web.1 queue=0 wait=0ms connect=2ms service=334ms status=200 bytes=3695
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T06:25:17+00:00Added an answer on June 18, 2026 at 6:25 am

    Since it’s not showing up on your SendGrid dashboard, my guess would be that your credentials are wrong in the app. If you type heroku config do you see that SENDGRID_USERNAME and SENDGRID_PASSWORD are set correctly?

    Also, you might want to try setting delivery errors to display in your config file.

    config.action_mailer.raise_delivery_errors = true
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a user profile page on my web app which has contact information.
I am working on a single-page app using Backbone.js. An issue that has occurred
My app has a common class that displays an actionSheet whenever Contact Us is
In Apple's Contacts app, if you go to a contact that has two emails
My app has a simple signup where the user types in his/her email address
how can i re-direct to a particular page after the user submits the contact
I've got an app that has a table view that displays contact information in
Background info I have an app where users can make microsites ala http://myname.the_app.com .
My droid app has a button on the main page that gives you an
The Red Cross has a locator page where you can submit a zip code

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.