Skip to main content

@napacitor/email

Email plugin wrapping the .NET MAUI Email API: compose and send emails.

Installation​

To use npm:

npm install @napacitor/email

To use yarn:

yarn add @napacitor/email

Sync native files:

npx nap sync

Usage​

import { Email } from '@napacitor/email';

// Check for support
const { supported } = await Email.isSupported();

if (supported) {
await Email.compose({
to: ['user@example.com'],
cc: ['admin@example.com'],
subject: 'Hello',
body: 'This is a test email.',
isHtml: false,
});
}

How It Works​

Wraps the .NET MAUI Email.Default.IsComposeSupported / ComposeAsync facade, opening the system mail client. compose() throws UNSUPPORTED when the device does not support it. Note: the plugin only invokes the system mail client and does not provide background silent sending; the attachments parameter is not mapped on the native side yet (MAUI EmailMessage supports attachments, but this plugin has not wired them up).

Permissions​

Android​

No additional configuration required.

iOS​

No additional configuration required.

Windows​

No additional configuration required.

API​

isSupported()​

Checks whether sending email is supported.

Returns: Promise<EmailSupportedResult>

compose(options?)​

Composes and sends an email (opens the system mail client); throws UNSUPPORTED when the device does not support it.

ParamType
optionsComposeOptions

Returns: Promise<void>

Interfaces​

ComposeOptions​

PropTypeDescription
tostring[]Recipient list.
ccstring[]CC list.
bccstring[]BCC list.
subjectstringEmail subject.
bodystringEmail body.
isHtmlbooleanWhether the body is HTML.
attachmentsstring[]Attachment list (file paths). Not mapped on the native side yet (MAUI EmailMessage supports attachments, but this plugin has not wired them up).

EmailSupportedResult​

PropTypeDescription
supportedbooleanWhether the device supports sending email.