You can’t send an email directly with javascript.
You can, however, open the user’s mail client:
window.open('mailto:[email protected]');
There are also some parameters to pre-fill the subject and the body:
window.open('mailto:[email protected]?subject=subject&body=body');
Another solution would be to do an ajax call to your server, so that the server sends the email. Be careful not to allow anyone to send any email through your server.
Related Posts:
- How to send an email from JavaScript
- Is JavaScript supported in an email message?
- What is TypeScript and why would I use it in place of JavaScript? [closed]
- How to do associative array/hashing in JavaScript
- Split string into array
- convert Hsl to rgb and hex
- How to play audio?
- How to write a countdown timer in JavaScript?
- TypeScript foreach return [duplicate]
- “Uncaught TypeError: Cannot read property ‘style’ of null at.. “
- Difference between document.referrer and window.parent.location.href
- JavaScript replace/regex
- how to render a react component using ReactDOM Render
- What does “javascript:void(0)” mean?
- What does this symbol mean in JavaScript?
- Go back button in a page
- ‘react-scripts’ is not recognized as an internal or external command
- Regex for password must contain at least eight characters, at least one number and both lower and uppercase letters and special characters
- OnChange event using React JS for drop down
- how to get the last character of a string?
- Set timeout for ajax (jQuery)
- Escaping Discord subset of markdown
- ESLint Parsing error: Unexpected token
- Angular ForEach in Angular4/Typescript?
- Timers in React Native (this.setTimeout)
- CSS height 100% percent not working
- Angular 4 setting selected option in Dropdown
- How to handle ETIMEDOUT error?
- bootstrap-datetimepicker for bootstrap 4
- Proper way to wait for one function to finish before continuing?
- XMLHttpRequest module not defined/found
- Module not found: Error: Can’t resolve ‘fs’ in
- TypeError: $(…).modal is not a function with bootstrap Modal
- How to do fade-in and fade-out with JavaScript and CSS
- I want to remove double quotes from a String
- Calculating median – javascript
- Vue is not defined
- How to remove all listeners in an element?
- How do I check if an object has a key in JavaScript?
- How to add a “readonly” attribute to an ?
- How to change value of object which is inside an array using JavaScript or jQuery?
- How to detect pressing Enter on keyboard using jQuery?
- How to make your Discord Bot always active
- How to write inside a DIV box with javascript
- use Lodash to sort array of object by value
- Chrome/jQuery Uncaught RangeError: Maximum call stack size exceeded
- Counting words in string
- What’s “this” in JavaScript onclick?
- how to use react require syntax?
- How to make fadeOut effect with pure JavaScript
- How to get unique values in an array
- How to fix Error: listen EADDRINUSE while using NodeJS?
- How to allow CORS in react.js?
- Set scroll position
- .filter is not a function
- Function overloading in Javascript – Best practices
- Wait until flag=true
- momentJS date string add 5 days
- When is a CDATA section necessary within a script tag?
- How to get scrollbar position with Javascript?
- where is create-react-app webpack config and files?
- “You may need an appropriate loader to handle this file type” with Webpack and Babel
- How to create checkbox inside dropdown?
- What does wp-embed.min.js do in WordPress 4.4?
- How to wrap the content of the main tinyMCE editor with extra tags
- Rest API authentication issue when called from fetch request in bundle.js
- Javascript not working?
- Add Item to Custom TinyMCE Menu
- Listbox return wrong value in WordPress 3.9
- Logout user and delete cookies from the client side?
- How do developers add “Smooth Transitions” to their sites?
- Exclude JS file from 404 error page
- How can I get my Calculate Contact Form 7 field to update with jQuery? [closed]
- Contact Form 7 – Uncaught TypeError: wpcf7.initForm is not a function [closed]
- Where is script-loader.php creating JS tags
- Search for a keyword across post types in a Gutenberg component
- Where to upload JavaScript file in WordPress
- Calling a WordPress Custom JavaScript file
- Custom Block – save.js function not saving attributes
- How do I know if I should enqueue JS code or just include it in ONE PHP function?
- print script on wordpress header after user registered
- How do I use this javascript correct with wordpress?
- How can I integrate yepnope.js with WordPress (and plugins)?
- How to set javascript options for select2 in PHP array of plugin
- Multiple jQuery inputs or binds in Customizer Control Javascripts
- How to display different content on the same page using different URLS
- Immediate (e.g. without DOMContentLoaded) JS not working
- Client side pre-save Javascript hook on all admin pages
- WP Gutenberg – custom block with two content fields
- Script not working in post content
- How to identify which javascript is being executed
- How could I add load more posts to my theme? [closed]
- How to keep close a sub-menu under homepage? [closed]
- How to implement custom URL handler to access JS modal content? [closed]
- Contact form 7 hide and show fields depending up on the condition [closed]
- Javascript button to call custom fields data
- Javascript 2 elements dependent onclick .toggle [closed]
- wp_enqueue has a resource but doesn’t generate a script tag [duplicate]
- How can I look at/edit what’s being sent to post.php when I hit the publish/update button?