KSCrash icon indicating copy to clipboard operation
KSCrash copied to clipboard

macOS application getting "Cannot send mail on this platform" error.

Open kondak3 opened this issue 4 years ago • 2 comments

Below code we used.

func installCrash() {
        
        // add crash report
        let installation = self.crashReportEmail()
        installation.install()
        KSCrash.sharedInstance()?.deleteBehaviorAfterSendAll = KSCDeleteNever
        installation.sendAllReports { (reports, completed, error) in
         if completed {
              print("Sent reports: \(String(describing: reports))")
            } else {
                 print("Failed to send report: \(String(describing: error?.localizedDescription))")
            }
        }
    }
    
func crashReportEmail() -> KSCrashInstallation {
        
        // email instance creation.
        let email = KSCrashInstallationEmail.sharedInstance()
        email?.recipients = ["[email protected]"]
        email?.subject = "Crash Report"
        email?.message = "This is a crash report"
        email?.filenameFmt = "crash-report-%d.txt.gz";
        email?.addConditionalAlert(withTitle: "Crash Dectected",
                                      message: "The app crashed last time it was launched. Send a crash report?",
                                      yesAnswer: "Sure!",
                                      noAnswer: "No thanks")
        email?.setReportStyle(KSCrashEmailReportStyleApple, useDefaultFilenameFormat: true)
        return email!
    }

ERROR: KSCrash.m (341): -[KSCrash sendAllReportsWithCompletion:]_block_invoke: Failed to send reports: Error Domain=KSCrashReportSinkEMail Code=0 "Cannot send mail on this platform" UserInfo={NSLocalizedDescription=Cannot send mail on this platform} Failed to send report: Optional("Cannot send mail on this platform")

kondak3 avatar Jun 08 '20 10:06 kondak3

In addition, on iOS mailto:// is not supported. That is needed if the user has not configured Mail and is using another default mail app such as Outlook.

phedlund avatar Sep 22 '21 01:09 phedlund

same problem

cheng-ren avatar Oct 10 '22 05:10 cheng-ren