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 9076937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T19:13:11+00:00 2026-06-16T19:13:11+00:00

I’m currently working on sending emails via sendgrid and currently sending emails to new

  • 0

I’m currently working on sending emails via sendgrid and currently sending emails to new users is working. …But strangely, very similar emailing options aren’t working – the full email including the recipient is displayed in the log but is never received.

Here’s what I have:

In a mail.rb file in initializers:

ActionMailer::Base.smtp_settings = {
  :address        => 'smtp.sendgrid.net',
  :port           => '587',
  :authentication => :plain,
  :user_name      => configatron.sendgrid.username,
  :password       => configatron.sendgrid.password,
  :domain         => 'heroku.com'
}

ActionMailer::Base.delivery_method = :smtp

with the username and password being defined elsewhere – they are confirmed to have their correct values

When a new user registers, I call my UserMailer class and do the following:

def welcome_email(user)
    @email = user.email
    @name = user.full_name

    mail(to: @email, subject: "Welcome!")
end

And the worker calls it by simply doing the following:

UserMailer.welcome_email(user).deliver

This much works; I receive the email and that’s that.

But when I try to send an email from a different method, magically things break down.

In the SAME UserMailer class:

def request(org, recipient, item)
  @org = org
  @recipient = recipient
  @item = item

  mail(to: @org.email, subject: "A new request has been posted!")
end

Using the SAME function (although this time outside of a worker so I can debug easily):

UserMailer.request(org, recipient, item).deliver

The email appears in the terminal perfectly:

Sent mail to mypersonalemail@test.com (4717ms)
Date: Mon, 31 Dec 2012 01:03:35 -0800
From: mysendingemail@test.com
To: mypersonalemail@test.com
Message-ID: <[longhexstring]@localhost.localdomain.mail>
Subject: A new request has been posted!
Mime-Version: 1.0
Content-Type: multipart/alternative;
boundary="--==_mimepart_50e154e769903_3c41bba7ec576d5";
charset=UTF-8
Content-Transfer-Encoding: 7bit



----==_mimepart_50e154e769903_3c41bba7ec576d5
Date: Mon, 31 Dec 2012 01:03:35 -0800
Mime-Version: 1.0
Content-Type: text/plain;
charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-ID: <[longhex]@localhost.localdomain.mail>

Hello world!

----==_mimepart_50e154e769903_3c41bba7ec576d5
Date: Mon, 31 Dec 2012 01:03:35 -0800
Mime-Version: 1.0
Content-Type: text/html;
charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-ID: <[longhex]@localhost.localdomain.
<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
</head>
  <body>
    <p>
Hello world!
    </p>
  </body>
</html>

But, I check my inbox on my personal email, the junk, the trash, and received nothing. Even sendgrid has no logs of me ever requesting to send request emails! But the welcome emails are working perfectly fine, and even are logged through sendgrid. I don’t see what could cause one group of emails to send but not another and this is really baffling. No obvious errors in syntax jump out at me, and the values I use are of the correct datatype and not nil.

Any help with this strange issue would be extremely appreciated.

  • 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-16T19:13:12+00:00Added an answer on June 16, 2026 at 7:13 pm

    The solution ended up being remarkably simple, so for those who find this thread and need help I’ll at least post what I did.

    In development.rb I did the following to see the error being raised:

    config.action_mailer.raise_delivery_errors = true
    

    And got this message:

    Net::SMTPFatalError - 550 Cannot receive from specified address <mypersonalemail@test.com>: Unauthenticated senders not allowed
    

    Which is strange considering I thought I was authenticated with the info I put into .env Outputting my configatron.sendgrid.username sure enough is nil. Still trying to figure out why that would be and I’m still not sure how the welcome emails were sent.

    Sure enough, changing my smtp settings to be hardcoded values for authentication worked like a charm. Now the question becomes how to get the ENV to not come out nil…

    The end solution was simply me being on the wrong localhost. I was using rails’s default rails server at port 3000, but foreman start (not sure if by default but in my project’s case) was using port 5000 instead.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want use html5's new tag to play a wav file (currently only supported
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
This could be a duplicate question, but I have no idea what search terms
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I want to construct a data frame in an Rcpp function, but when I
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
I need to clean up various Word 'smart' characters in user input, including but

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.