Skip to content

Instantly share code, notes, and snippets.

@waifung0207
Created July 16, 2014 14:08
Show Gist options
  • Save waifung0207/10b7bcc4646eef8877e5 to your computer and use it in GitHub Desktop.
Save waifung0207/10b7bcc4646eef8877e5 to your computer and use it in GitHub Desktop.
CodeIgniter email config file (Mailgun custom domain + TLS)
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| EMAIL CONFING
| -------------------------------------------------------------------
| Configuration of outgoing mail server.
| */
$config['protocol'] = 'smtp';
$config['smtp_host'] = 'ssl://smtp.mailgun.org';
$config['smtp_port'] = '465';
$config['smtp_timeout'] = '30';
$config['smtp_user'] = 'postmaster@mydomain.com';
$config['smtp_pass'] = 'password';
$config['charset'] = 'utf-8';
$config['mailtype'] = 'html';
$config['wordwrap'] = TRUE;
$config['newline'] = "\r\n";
/* End of file email.php */
/* Location: ./system/application/config/email.php */
@anilkreddy
Copy link

Hey but this is not working with GoDaddy hosting. I'm getting Message: fsockopen(): unable to connect to tls://smtp.mailgun.org:587 (Connection refused)

Same with ssl://smtp.mailgun.org:465

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment