I can't send emails from my Android device in Monaca.

Asked 2 years ago, Updated 2 years ago, 108 views

with the following code:
function sendMail(){
    window.plugins.webintent.startActivity(
        {
            action: window.plugins.webintent.ACTION_VIEW,
            url: 'mailto:mail address'
        },       
        function() {},
        function() {alert('Failed to open URL via Android Int');}
    );
}

The following error appears:

Uncaught TypeError: Cannot read property 'webintent' of undefined

Cordova webintent is enabled.
The following is also specified:

<script src="components/loader.js"></script>
<link rel="stylesheet" href="components/loader.css">

There may be some lack of settings.
Please teach me.

android monaca cordova

2022-09-29 22:27

1 Answers

It was resolved by adding the following to config.xml: mailto instead of mail.

<allow-intent href="mailto:*"/>

This post was posted as an individual answer based on the answers that were added to the question.


2022-09-29 22:27

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.