7

I'm looking for OpenShift configuration information for sendmail functionality.

It's not totally clear to me what the preferred way of doing it is.

Some articles say that one must have the pear/Mail.php modules installed, others say that this would be when using a relay. Others say that OpenShift supports outgoing mail by default, although with some issues.

Then I've looked for cartridges that may be available, if that is the approach, but no luck there, although there is a SendGrid quickstart.

All I'm trying to do really, is send a couple of emails from my application. No large quantities, or mass marketing mailings.

Can someone please give me the short and sweet how-to?

Thanks in advance.

Maxcot
  • 1,513
  • 3
  • 23
  • 51
  • 2
    Why not use [Codeigniter Email Class](http://ellislab.com/codeigniter/user-guide/libraries/email.html)? – Khawer Zeshan Jul 11 '13 at 00:39
  • yes, I am using that, but my question is around the infrastructure that supports it. The configuration parameters, the OpenShift environment variables, etc....? – Maxcot Jul 11 '13 at 01:32

1 Answers1

6

OpenShift Online is hosted on Amazon's EC2 service. Most email servers are configured to detect and blacklist emails originating from EC2 when it detects spam. So although it may work initially, there is a chance that emails start to silently fail after some time due to being blacklisted.

It is recommended to relay through 3rd party smtp server/service:
https://www.openshift.com/blogs/email-in-the-cloud-with-mailgun
https://www.openshift.com/blogs/enabling-transactional-email-on-paas-with-sendgrid

Nam Duong
  • 851
  • 5
  • 4
  • So would this be a short and sweet summary? (1) install pear/Mail on the OpenShift application, (2) Select a 3rd party SMTP service like MailGun, or the SendShift Gear on OpenShift, or gmail if you have an account there. (3) write whatever code the app requires (mine is in PHP/CodeIgniter) to sendMai, and all should be good. – Maxcot Jul 12 '13 at 01:22
  • A very usable answer that solved my problem: http://stackoverflow.com/questions/1555145/sending-email-with-gmail-smtp-with-codeigniter-email-library – Maxcot Jul 12 '13 at 04:19
  • Wow. Is there a way to get on a some whitelist? Perhaps Amazon or Red Hat has somethink like "trusted web apps"... – Ondra Žižka Jul 14 '13 at 07:20
  • @Maxcot, gmail is an alternative that worked in the past. However, they started to fail since they moved to oauth: https://www.openshift.com/forums/openshift/send-emails-from-openshift – Nam Duong Jun 30 '14 at 19:34