Closed imgruntw closed 6 years ago
Hmm. Maybe that name for the fromUser is causing problems? Would it be possible for you to share the repo you're using?
I am thanking for speedy responses! Here is my repo: https://github.com/imgruntw/SwiftToolBox
How are you running this project? When I run, nothing is happening. It may not be related to Swift-SMTP.
swift package generate-xcodeproj
send()
in /SwiftToolBox/Sources/SwiftToolBoxCore/SwiftToolBoxCore
SwiftToolbox
and then runthe Method: send()
in /SwiftToolBox/Sources/SwiftToolBoxCore/SwiftToolBoxCore
is executed, but without sending an email and without any errors
Perhaps execution of the program is ending before the asynchronous task can finish. When I put a print statement in the closure of smtp.send()
, the print statement is not executed but the program returns with exit code 0.
Thanks, waiting for end of the asynchronous task with was the solution .
I can't send email from my gmail account with following code: ` import SwiftSMTP
public final class SwiftToolBoxCore { public func send() -> Void { let smtp = SMTP( hostname: "smtp.gmail.com", email: "myaccount@gmail.com", password: "mypassword", tlsMode: .requireSTARTTLS )
} `
There is no error message. Not secure apps are allowed on my gmail account. What I am doing wrong?