Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sample of working email configuration #108

Closed
DaneWeber opened this issue Nov 26, 2013 · 20 comments
Closed

Sample of working email configuration #108

DaneWeber opened this issue Nov 26, 2013 · 20 comments

Comments

@DaneWeber
Copy link

I didn't expect to spend so much time trying to get SMTP working. Would someone be so kind as to share their .env that works?

I'd love to see a GMail example and a local/ISP example. If you don't want to share your personal info, just replace the specific address and password as if it is for john.doe@gmail.com or john.doe@example.com with a password of "abc123".

I may just have a specific issue with my local setup, but I've made some telnet tests that seem to indicate that I can talk to the SMTP servers I'm specifying in my .env.

@albertsun
Copy link
Contributor

What have you tried so far?

What's shown in the .env.example file works for me.

Some providers may have authentication of "login" instead of "plain".

@DaneWeber
Copy link
Author

My .env is here: https://gist.github.com/Fluffums/7675427

It's set up for Gmail. I'd love to just get Gmail working.

One thing I noticed when posting my .env is that it has "" instead of my SQL root password.

Here is what I believe is the relevant section:
SMTP_DOMAIN=gmail.com
SMTP_USER_NAME=john.doe@gmail.com
SMTP_PASSWORD=abc123
SMTP_SERVER=smtp.gmail.com
SMTP_PORT=587
SMTP_AUTHENTICATION=plain
SMTP_ENABLE_STARTTLS_AUTO=true

@albertsun
Copy link
Contributor

Hm. That looks right to me.

Can you see what's in the log when it tries to send emails? Do other things work?

@DaneWeber
Copy link
Author

Is there some additional log somewhere? The log via the UI in the browser says it's sending me email all the time.

@cantino
Copy link
Member

cantino commented Nov 28, 2013

Yes, take a look at the Rails log, either as it prints in the console or
via the files log/development.log and log/delayed_job.log

On Wednesday, November 27, 2013, Fluffums wrote:

Is there some additional log somewhere? The log via the UI in the browser
says it's sending me email all the time.


Reply to this email directly or view it on GitHubhttps://github.com//issues/108#issuecomment-29420751
.

@cantino
Copy link
Member

cantino commented Dec 8, 2013

Were you able to get this figured out, @Fluffums?

@DaneWeber
Copy link
Author

No. :-( Here's an excerpt from my development.log: https://gist.github.com/Fluffums/7897748

I'm going to get mailsend on the Huginn host computer to make sure it can talk to the Gmail SMTP server.

-Dane

@DaneWeber
Copy link
Author

Looks like this might be a relatively special situation. Mailsend responds with an error about my username/password combo: "535 5.7.8 Username and Password not accepted." Incredibly weird, because the exact same parameters work just fine from my Windows box, but are failing on my Linux box that hosts Huginn.

So, I've now tried using a different Gmail account as the sender with Mailsend, and it works from the Linux box.

@DaneWeber
Copy link
Author

Whoops. That wasn't the end of the story. I changed the .env for Huginn to use the Gmail account that works from the Linux box. No good. :-(

@cantino
Copy link
Member

cantino commented Jan 11, 2014

Hey @Fluffums, were you able to figure this out?

@Alex-Ikanow
Copy link
Contributor

Incidentally since I probably spent an embarrassing amount of time trying to get email working .... it might be worth nothing somewhere prominent that it is turned off by default in "development" mode (d'oh!) and silently doesn't send emails... based on his log, I assume this was the OP's issue?

@DaneWeber
Copy link
Author

Argh! Seriously? @Alex-Ikanow, how do you turn it on? What completely obvious thing have I been missing this whole time? @cantino, I was going to give it one more shot before responding to you, but no, I didn't figure this out.

@Alex-Ikanow
Copy link
Contributor

1] Edit "config/environments/development.rb"

2] Change "config.action_mailer.perform_deliveries = false # Enable when testing!" to true

3] Try to avoid throwing anything through a window :)

@cantino
Copy link
Member

cantino commented Jan 14, 2014

Okay, maybe we should change that default. FWIW, it is in the Readme as of fairly recently.

@DaneWeber
Copy link
Author

I don't know that you need to change the default. For someone approaching this in the same way I did, what would be most helpful would be an additional line in the .env.example file in the email configuration section, reading something like this:

# In order to enable email sending, you must also change config.action_mailer.perform_deliveries to true in the config/environments/development.rb file.

It's working for me now. So far, I haven't thrown anything through a window.

@cantino
Copy link
Member

cantino commented Jan 16, 2014

I will make that change now, thanks!

@cantino cantino closed this as completed Jan 16, 2014
@vivekraj2007
Copy link

I am unable to get emails in localhost, I added email address as receipnts in morningdigest agent, and I run the scheduler by following command in new terminal

bundle exec rails runner bin/schedule.rb

Thanks

@cantino
Copy link
Member

cantino commented Oct 14, 2014

Did you change config.action_mailer.perform_deliveries to true in the config/environments/development.rb?

@anishvarghese
Copy link

I have problem while using outlook client to sent mails

@anishvarghese
Copy link

Unrecognized authentication type [BN6PR14CA0038.namprd14.prod.outlook.com]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants