When I generate mail in the webintent plug-in, some of it is written in the mail application.

Asked 2 years ago, Updated 2 years ago, 109 views

We are developing a smartphone application with monaca.
We create a flowchart in the application, text out answers such as "Yes" and "No" to launch the mail software and display it in the body of the mail.

The andoroid terminal was unable to use mailto (mailer does not start), so I use the webintent plug-in for Android.

You can start the mailer, but the text of the mail is garbled by the mail software (docomo carrier mail, Gmail, etc.) that starts inside the terminal.
Currently, there is no problem with Gmail below.The characters are garbled in docomo mail is garbled.
If you take advantage of the comment out part, docomo is OK, but it will be garbled in Gmail.
What should I do?

function android_mailto(){            
        varhiduke = new Date();
        var year=hiduke.getFullYear();
        varmonth=hiduke.getMonth()+1;
        var day=hiduke.getDate();
        var hour=hiduke.getHours()
        var minute=hiduke.getMinutes();
        var subject = year + year + month + month + month + day + day + day + hour + hour + minute + minute;
        // var result = unescape (encodeURIC component (body));
        var result=body

        window.plugins.webintent.startActivity(
                {
                    action: window.plugins.webintent.ACTION_VIEW,
                    url: 'mailto:?subject='+subject+"&body="+result
                },
                function() {},
                function() {alert('Failed to open URL via Android Int');}
            );
    }

javascript android monaca gmail

2022-09-29 21:31

1 Answers

I am writing to let you know that I have solved myself.

After changing the line feed code from (ios)%0D%0A to (android)\x0D\x0A, the characters are no longer garbled.

Thank you, everyone.


2022-09-29 21:31

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.