You can let user choose it via Intent
as so:
Intent email = new Intent(Intent.ACTION_SEND); email.setType("message/rfc822"); email.putExtra(Intent.EXTRA_EMAIL,new String[]{ "[email protected]" }); email.putExtra(Intent.EXTRA_SUBJECT,"INSERT SUBJECT HERE"); email.putExtra(Intent.EXTRA_TEXT,"INSERT BODY HERE"); try{ Intent.createChooser( email, null ); }catch(ActivityNotFoundException e){ // WHATEVER }
Letting the default app handle the email:
Intent intent = new Intent(Intent.ACTION_VIEW); Uri data = Uri.parse("mailto:?subject=" + subject + "&body=" + body); intent.setData(data); startActivity(intent);
Explanation can be found here: https://stackoverflow.com/a/3312562/1894684
Related Posts:
- How do I link a JavaScript file to a HTML file?
- JavaScript runtime error: ‘$’ is undefined
- JavaScript Loading Screen while page loads
- Set selected option of select box
- Click button copy to clipboard
- How to make html table vertically scrollable
- How to make a simple image upload using Javascript/HTML
- How to make Bootstrap carousel slider use mobile left/right swipe
- How to Show External website inside another page without iFrame? [closed]
- bootstrap 3 navbar collapse button not working
- Display XML content in HTML page
- Bootstrap carousel not sliding
- Play/pause HTML 5 video using JQuery
- jQueryUI dialog width
- Clear form fields with jQuery
- How to call a webservice method from an html page [javascript] with out refresh the page
- Javascript – ERR_CONTENT_LENGTH_MISMATCH
- Random background images CSS3
- $(document).ready(function() is not working
- Show div #id on click with jQuery
- How do I remove a box-shadow effect from an element when another element is hovered?
- Slide right to left?
- jQuery UI Datepicker not working
- WP set auth cookie using Ajax is not saved to browser
- Basic WordPress AJAX Call
- Hide/show customizer controls based on other settings in Customizer
- Vimeo Froogaloop API, working in Fiddle but not WP
- WordPress site in China times out on requests to youtube [closed]
- Accordion scrolls page too low after clicking on the title [closed]
- WordPress Comments – Rich Text
- Adding a slide toggle on WordPress
- specifying relative file paths in WP with jQuery requests not working
- How to keep HTML form field that is conditional hidden with javasript hidden after page reload?
- Need workaround for insecure XMLHttpRequest endpoint request
- click event to unhide something after ajax not firing
- WP AJAX API with JS file
- Insert a Featured Video
- How to use JQuery Marquee in WordPress?
- JQuery script working locally on desktop, not working on WordPress + Divi
- Loop through WordPress API response errors
- Getting click on item to open closest relevant element (popup) with jQuery
- How can publish my bootstrap created table ( huge amount of data) on my word-press theme?
- jQuery for Fade Preload Causes My Site Favicon to Disappear from Tab of Browser
- how to allow download after newsletter subscription?
- jQuery function not working in WordPress but works in jsfiddle
- Site images are fixed in front of my site content [closed]
- How can I add a new lib path without call each one on the header?
- change the icon of a custom post type in WordPress to use twitter boostrap
- can’t make jQuery work (change image on time interval) [closed]
- Contact Form 7 – Submit Form not working After Ajax Request [closed]
- Create table with jQuery – append
- Jquery to change form action
- How can I expand and collapse a using javascript?
- Android Overriding onBackPressed()
- Detecting value change of input[type=text] in jQuery
- JQuery: ‘Uncaught TypeError: Illegal invocation’ at ajax request – several elements
- Changing the selected option of an HTML Select element
- How do I send this form's output to a new WordPress page?
- Annoying “JQMIGRATE: Migrate is…” in console after update to WordPress 4.5
- Update jquery version
- Correct Method to run scripts with dependencies without enqueue?
- ajax live search for post title
- WordPress Ajax always returns a 404 error
- Modify Custom Field in Media Library using JavaScript
- Loading jQuery With Two Fallbacks
- Including jQuery in WordPress
- Comment form vaildation
- Enqueuing jQuery in plug-ins
- TinyMCE – TypeError: r is undefined
- Auto-detect javascript errors and warn theme user
- combining js scripts from a js newb [closed]
- Heartbeat API: How to access data already enqueued?
- How to stop focus() in custom js from scrolling to footer?
- Getting post meta in the flex slider
- Removing jQuery from footer
- Use jQuery to conditionally hide elements in Quick Edit
- Unexpected script loading order
- Problem passing id-specific objects to javascript via wp_localize_script
- Creating a new div onclick wordpress+ajax
- Properly embed javascript into WP (using function.php) – doesn’t work?
- jQuery tabs plugin with callback to fetch data
- Cherry Framework theme, JQuery is using HTTP not HTTPS
- Making jQuery-based galleries with WordPress without a plugin?
- Long contextual help needs two clicks to close
- How to make jquery slider to start afresh [closed]
- Can’t Listen to KeyDown in TInyMCE Iframe (jQuery) and Pass it to Parent HTML FORM
- How to pull data from a table using wpdb?
- Is not using admin-ajax to ajax submissions okay?
- Visual editor popover or placeholder
- Masonry – Can’t Find Variable imagesLoaded
- Custom button on admin page doesn’t trigger click event
- How to update scrollbar when using Jetpack’s Inifnite Scroller?
- Element works, but not on wordpress site [duplicate]
- Getting “ReferenceError: jQuery is not defined” – don’t know why!
- Can’t get jQuery to enqueue into post edit script
- Contact Form 7 checkbox to add a new class to a div [closed]
- Infinite Scroll applied to ajax loaded content
- using jquery autocomplete in wordpress plugin
- Make this jQuery toggle snippet target each list item individually [closed]
- Can’t seem to check off a category checkbox with jquery?