• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Does CodeIgniter SMTP client actually use TSL to send email?

#1
I configured my email settings to connect to sendgrid on port 587 and use tsl:
Code:
$config["useragent"] = "CodeIgniter";
$config["protocol"] = "smtp"; // or mail or sendmail
$config["mailpath"] = "/usr/sbin/sendmail";
$config["smtp_host"] = "smtp.sendgrid.net";
$config["smtp_user"] = "apikey";
$config["smtp_pass"] = "<SENDGRID-API-KEY-HERE>";
$config["smtp_port"] = 587;
$config["smtp_crypto"] = "tsl";
$config["dsn"] = FALSE;
// ETC
I wrote a short script on a controller:
Code:
    public function mailtest()
    {
        
        $this->load->library('email');
        
        $this->email->from([email protected]', $this->config->item("site_name"));
        $this->email->to([email protected]');
        
        $this->email->subject('Email Test ' . microtime(TRUE));
        $this->email->message('Testing email config with new port');
        
        $this->email->send(FALSE);
        header("content-type: text");
        echo ($this->email->print_debugger());
        die("done");
    }

When I look at the output of print_debugger(), I don't see any STARTTLS command:
Code:
220 SG ESMTP service ready at ismtpd0003p1sjc2.sendgrid.net
<br /><pre>hello: 250-smtp.sendgrid.net
250-8BITMIME
250-PIPELINING
250-SIZE 31457280
250-STARTTLS
250-AUTH PLAIN LOGIN
250 AUTH=PLAIN LOGIN
</pre><pre>from: 250 Sender address accepted
</pre><pre>to: 250 Recipient address accepted
</pre><pre>data: 354 Continue
</pre>250 Ok: queued as tegwA0rzQKWW-zhM2QCUYg
<br /><pre>quit: 221 See you later
</pre>Your message has been successfully sent using the following protocol: smtp<br /><pre>Date: Thu, 23 Mar 2017 17:57:40 -0700
From: &quot;sneakyimp workstation&quot; &lt;[email protected]&gt;
Return-Path: &lt;[email protected]&gt;
To: [email protected]
Subject: =?UTF-8?Q?Email=20Test=20149031706?==?UTF-8?Q?0.8739?=
Reply-To: &lt;[email protected]&gt;
User-Agent: CodeIgniter
X-Sender: [email protected]
X-Mailer: CodeIgniter
X-Priority: 3 (Normal)
Message-ID: &lt;[email protected]&gt;
Mime-Version: 1.0


Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Testing email config with new port
</pre>
Is the server output truncated or something? How can I be sure that my server's interactions with the SMTP gateway are encrypted?
Reply

#2
Aha...I see in retrospect that I had an error in my email config. I had tsl instead of tls. Seems to me the mailer object should throw an exception or an error if the smtp_crypto method is not recognized.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2017 MyBB Group.