katzer / cordova-plugin-email-composer

Edit and send email messages
Apache License 2.0
345 stars 336 forks source link

Cant send email IOS 13 #346

Closed Eugene-Lytvynov closed 2 years ago

Eugene-Lytvynov commented 4 years ago

Hi. After email open, we see a composer window, but send button not active.

======================== code ========================= sendEmailExecuteAndroid(aTeacherEmail: string): Promise { return new Promise( (resolved, rejected) => { this.emailService.open( { to: [aTeacherEmail], cc: [], bcc: [], subject: '', body: '', } ) .then(() => resolved()) .catch(error => rejected(error)); } )

}

=================== LOG =======================

o Native Cordova -> EmailComposer open EmailComposer1110454383 ["options": [{ app = "mailto:"; attachments = ( ); bcc = ( ); body = ""; cc = ( ); chooserHeader = "Open with"; from = ""; isHtml = 0; subject = ""; to = ( "sales@some-company.com" ); }]] 2020-04-08 07:27:53.964886-0700 App[4644:1801229] [MFMailComposeViewController] is not a valid email address. 2020-04-08 07:27:54.311420-0700 App[4644:1801642] [Common] [FBSSystemService][0xbaa0] Error handling open request for com.apple.mobilemail: <NSError: 0x281834060; domain: FBSOpenApplicationServiceErrorDomain; code: 1 (RequestDenied); reason: "The request was denied by service delegate (SBMainWorkspace) for reason: Security ("Un-trusted clients may not open applications in the background")."> { userInfo = { FBSOpenApplicationRequestID = 0xbaa0; } underlyingError = <NSError: 0x281834150; domain: FBSOpenApplicationErrorDomain; code: 3 (Security); reason: "Un-trusted clients may not open applications in the background.">; } 2020-04-08 07:27:54.311690-0700 App[4644:1801591] [General] #MailServices <MSAccounts: 0x2803b50c0> (0) : <connection: 0x28239c180> failed to send message <dictionary: 0x28329c5a0> NSError Domain=MailServices Code=2 APP INACTIVE APP ACTIVE

Eugene-Lytvynov commented 4 years ago

Looks like we found answer: it is heppends, if we use no app in parameters and not installed a default mailer in IOS.

Eugene-Lytvynov commented 4 years ago

Any case: why we still have this in logs: is not a valid email address. it not possible select from in IONIC 4 capacitor 2. This field not exist in type

o Native Cordova -> EmailComposer open EmailComposer1567518029 ["options": [{ app = "mailto:"; attachments = ( ); bcc = ( ); body = ""; cc = ( ); chooserHeader = "Open with"; from = ""; isHtml = 0; subject = ""; to = ( "sales@some-company.com" ); }]] 2020-04-08 08:00:29.148274-0700 App[4702:1814292] [MFMailComposeViewController] is not a valid email address.

Eugene-Lytvynov commented 4 years ago

if we try to write:

this.emailService.open( { from: ['mail@some-company.com'], to: [aTeacherEmail], cc: [], bcc: [], subject: '', body: '', } ) .then(() => resolved()) .catch(error => rejected(error));

we have compilation error

error TS2345: Argument of type '{ from: string[]; to: string[]; cc: undefined[]; bcc: undefined[]; subject: string; body: string; }' is not assignable to parameter of type 'EmailComposerOptions'. Object literal may only specify known properties, and 'from' does not exist in type 'EmailComposerOptions'.

[ERROR] An error occurred while running subprocess ng.

jfoclpf commented 2 years ago

maybe duplicate of #363