How to send an email from app?

6 posts, 0 answers
  1. Marcus
    Marcus avatar
    33 posts
    Member since:
    Jul 2012

    Posted 16 Jan 2013 Link to this post

    Is there a way to send an email/pop open the default email app from an Icenium app?  

    I tried the window.location = 'mailto:test@test.test?body=Hello World'; method, but it doesn't seem to open the default email application (I also don't know if it will work on iPhone).

    I know there are some plugins that allow this, but we can't add in plugins yet.

    Does anybody know of a way to do this?
  2. Kristian D. Dimitrov
    Admin
    Kristian D. Dimitrov avatar
    68 posts

    Posted 17 Jan 2013 Link to this post

    Hi Marcus,

     You don't have to use a plugin to call the native e-mail app. You can try using window.location.href = "mailto:test@test.com?subject=test"; . I tested it on iPhone5 with iOS 6.0.1, HTC EVO 3D with Android 4.0.1 and Samsung Galaxy 2 with Android 2.3.3.

    Regards,
    kdimitrov
    the Telerik team

    Share feedback and vote for features on our Feedback Portal.
    Want some Kendo UI online training - head over to Pluralsight.
  3. Marcus
    Marcus avatar
    33 posts
    Member since:
    Jul 2012

    Posted 17 Jan 2013 Link to this post

    That's what I tried. However, it opened up the "Email" app, which said I didn't have any accounts then immediately closed. I want it to open the "GMail" app instead. So I'm assuming there's no way to pick which email app it opens?
  4. Kristian D. Dimitrov
    Admin
    Kristian D. Dimitrov avatar
    68 posts

    Posted 18 Jan 2013 Link to this post

    Hello Marcus,

    Unfortunately, when you use "mailto:" the default email application for the device is opened.

    Kind regards,
    kdimitrov
    the Telerik team

    Share feedback and vote for features on our Feedback Portal.
    Want some Kendo UI online training - head over to Pluralsight.
  5. Craig
    Craig avatar
    7 posts
    Member since:
    Apr 2015

    Posted 05 May 2015 in reply to Kristian D. Dimitrov Link to this post

    Hi,

    Created a simple app with a contact page for my Android app. When I test the app on the simulator to send emails it opens the desktops mail account. However on my device nothing happens.

     <a data-role="button" id="myElement" data-rel="external" href="mailto:support@example.com">Contact us</a>

     Any ideas what I am missing?

     

    Thanks

  6. Zdravko
    Admin
    Zdravko avatar
    657 posts

    Posted 08 May 2015 Link to this post

    Hi Craig,

    Since Cordova 3.7, where security fixes were applied, you will have to whitelist any non http/s protocols in the config.xml in order to use them again.
    In your case you need to add the mailto protocol:
    <access origin="mailto:*" launch-external="yes"/>

    If you still have troubles and this is not your case, consider opening a private ticket where to provide a sample isolating your case.

    Regards,
    Zdravko
    Telerik
     

    Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

     
Back to Top