Kitura / Swift-SMTP

Swift SMTP client

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sending from Exchange Business email

willm132 opened this issue · comments

I am trying to send from an email using GoDaddy Office 365 Exchange. Every time I attempt to do this I am getting an error saying denied. How can I find out what port and security information to use with Swift SMTP?

The operation couldn’t be completed. (SwiftSMTP.SMTPError error 3.)

How can I find out what to put here:

hostname: String,
port: Int32 = 587,
tlsMode: TLSMode = .requireSTARTTLS,
tlsConfiguration: TLSConfiguration? = nil,
authMethods: [AuthMethod] = [],
domainName: String = "localhost",
timeout: UInt = 10

Looking at the source, SMTPError 3 may be:

    /// The preferred `AuthMethod`s could not be found, or your server is sending back a STARTTLS command and requires a connection upgrade.
    case noAuthMethodsOrRequiresTLS(hostname: String)

Perhaps using wireshark will help shed some light?

I attempted to change tslMode to .requiresSTARTTLS and I am getting the same error

I was able to fix this by enabling Authenticated SMTP from the mail server settings