Skip to content

Commit

Permalink
Fixing bugs of PR#6
Browse files Browse the repository at this point in the history
  • Loading branch information
RockfordWei committed Dec 29, 2017
1 parent c48c5a8 commit b53f218
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Sources/PerfectSMTP/PerfectSMTP.swift
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,14 @@ public struct SMTPClient {
public var password = ""

/// upgrade connection to use TLS
public var requiresTLSUpgrade
public var requiresTLSUpgrade = false

/// constructor
/// - parameters:
/// - url: String, smtp://somewhere or smtps://someelsewhere
/// - username: String, user@somewhere
/// - password: String
public init(url: String = "", username: String = "", password: String = "", requiresTLSUpgrade = false) {
public init(url: String = "", username: String = "", password: String = "", requiresTLSUpgrade: Bool = false) {
self.url = url
self.username = username
self.password = password
Expand Down Expand Up @@ -391,7 +391,7 @@ public class EMail {

// TO FIX: ssl requires a certificate, how to get one???
if client.url.lowercased().hasPrefix("smtps")
|| (client.url.lowercased().hasPrefix("smtp") && self.requiresTLSUpgrade) {
|| (client.url.lowercased().hasPrefix("smtp") && client.requiresTLSUpgrade) {
let _ = curl.setOption(CURLOPT_USE_SSL, int: Int(CURLUSESSL_ALL.rawValue))

// otherwise just non-secured smtp protocol
Expand Down

0 comments on commit b53f218

Please sign in to comment.