I'm new to rails and I'm trying to send emails through Ruby on Rails on the Cloud9 IDE however I am not receiving any even though it says it was successful.
Rendered invitation_mailer/invitation_email.html.erb (1.0ms)
Emailing invitation to example#example.com
InvitationMailer#invitation_email: processed outbound mail in 18.2ms
Is there a special configuration that I need to apply to Cloud9 to make it work?
Please note that ports 25, 587, and 465 are blocked from Cloud9 to the outside. Please try to run your mail server on a port like 2587.
Related
So I use Sendgrid, an external SMTP server handling transaction emails.
I just deployed my Rails app on a fresh new VPS, with Ubuntu on it.
In Sendgrid tutorial, I saw that I only have to set ActionMailer to point to sendgrid's SMTP address with proper username/password.
But I was met with Errno::ECONNREFUSED: Connection refused - connect(2) for "localhost" port 25 error, but I am sure I have set it to point to Sendgrid's 587 port. I searched online and someone suggested me to install postfix. I am guessing ActionMailer need a MTA on localhost.
Is sendmail or postfix a required package for using external SMTP service on Linux?
The answer is no, postfix or sendmail is not required.
ActionMailer/Mailer gem can connect to remote SMTP server directly.
As a side note, my localhost issue is that the keys of the config hash were somehow converted into String keys. Converting it to symbol keys fixed the issue.
I have a rails app deployed at a digital ocean droplet configured with capistrano and mailgun, but I'm having trouble sending emails, task which I do using delayed_jobs. The thing is every time it tries to send an email I get connection timeout (verified using RAILS_ENV=production bin/delayed_jobs runin the server) and I found out that for some reason digital ocean does not allow from default for you to access through port 587 (and indeed, running telnet smtp.mailgun.org 587 takes a very long time to access) but apparently trough port 2525 you can (mailgun also supports that port and running telnet smtp.mailgun.org 2525 connects instantly!). But again, it still gives me connection timeout, so I'm kind of confused and don't know what to do. I'll probably send a ticket to DO asking to open port 587, until then do you have any ideas?
Digital Ocean blocks SMTP for safety reasons, based on the CAN SPAM Act (https://www.ftc.gov/tips-advice/business-center/guidance/can-spam-act-compliance-guide-business), so if you want to send emails using SMTP in their servers you'll need to send a ticket asking to unblock it with some infos about yourself so they verify your not just some crazy guy trying to flood people mail boxes or a robot.
Hope it helps! Good luck
Anybody able to try and install Discourse as a normal Rails app (no Docker) and see why it won't send emails from ones localhost SMTP server?
Sending emails from other Rails apps work just fine.
https://meta.discourse.org/t/emails-with-local-smtp/23645/16
I have a rails app deployed on Google Compute Engine.
Everything works fine and it requires to send mail in application so I follow this link for sending mail it works on local but I am unable to send mail through mandrill smtp settings.
I always get Timeout::Error (execution expired) error message, what could be the reason??
Any idea on what's could be the problem?
Google Compute Engine does not support outbound TCP connections on port 25. Instead you can use port 2525 that Mandrill also supports.
I'm working on a rails project and can't figure out how the mail system works.
On the production server there is postfix installed, so I'm assuming thats how the emails are being sent (actually the headers show that it is postfix sending out the emails). However, in the application under config > environment > production.rb, there is nothing defining how to send the mail. There are no smtp settings, there is nothing saying its using sendmail or postfix, but the mails are being delivered. So how does the production server know to use postfix? I ask because the development server is using sendmail, so will anything need to be changed here for this to work or should it work out of the box (because it doesn't)?
Ok, so I figured out what was wrong, feel free to comment if you think my answer is not sufficient though or you have any feedback!
I found out from here that "Delivery defaults to an SMTP server running on your localhost on port 25." So on my production server it was working because postfix was installed. Where I was confused was staging, why wasn't sendmail working. I assumed sendmail was installed thats why! When I typed which sendmail, I got a result, so I assumed it was sendmail, but when I ran telnet <myhostname> 25 I got Exim 4.71! So a new assumption, sendmail is installed but not configured or setup on port 25, and exim is, so exim is handling mail.
I'm using this on amazon ec2 and just assumed that when I setup my instance, since its linux, it would have a mail server ready like I had on production. Obviously that was not a good assumption and I've now configured properly my prod, and I will try to use exim for staging since its already there.