Send email via HTML from predefined emailID - javascript

I have a feedback form which consist of 5 fields like name,contact Number etc, and a button to send. I want whenever user inputs the field and hits send button an email containing the values from these fields should be sent to a particular mail id bur "FROM MY DEFINED" mail address, I dont want mailto option as it allows the user to send email from his account.
I know this with ASP.NET but i need with simple HTML or javascript or jquery.
Please Help.
Thank You

You need a server side technology to send email.
If you want to use JavaScript, then there are a number of packages for sending email in npm. (Note this is server side JavaScript, the browser doesn't provide any tools that you can use for this).
The closest you can get to submitting form data over email with just common client side technologies is the mailto: scheme which:
You have already rejected
Doesn't work most of the time anyway

Related

How to trigger an API call on a button click inside an Email Template

This is a use case where an API has to be triggered when the user clicks a button on his/her email. The API call should hit the server to do some action in backend.
I tried some javascript (fetch, XMLHttpRequest), but also came to know that all email clients do not support javascript. Is it right? Is there any options other than javascript?
Most (nearly 99%) of mail clients and servers will put the mail with JS into spam or won't even let it into your inbox. Even the mail client must be able to work with JS. While in Outlook it can be enabled with plugins, you have to be 100% sure, that the receiver will receive it, otherwise you can`t do it.
Another way to fetch data/get mail info like statistics is to add a unique ID to all links used in the mail. By chance, the user will click on it and you can work with the data on server side.
But as allready mentioned: Don`t use JS in your mails. It's not ment for mails.

How to add Textbox and buttons to gmail messages and get the responce from them

I want to add two buttons to my gmail messages YES and NO if we pressed on YES then show one Textbox and a submit button .and if we press on submit button the value od the textbox must be saved. how can i achieve that . Am sorry for my bad language
You can do this simply using google form. Just follow the steps below
1) Go to google forms create a new form as you like
2) then click on send form choose send via email option mention the to email address, subject and message. Don't forget to check Include form in email option.
Then click on send button.
When the recipient receive this email that would contain an embedded google form. The responses of google form can be retrieve via email or it can be save into a linked excel file on google drive.
I think the easiest way to your problem is to put Links in your E-Mail, which redirect the user to a website of yours. If he presses no, then your website (where the user was redirected from the no-button) can just save the response and close the tab again. If the user presses yes, the user can enter the information in the textbox (in your website from the link from the yes-button) and save it on your website after the user submitted it.
That's usually the practice how such things work. Another example for this is unsubscribing from newsletters. There you also get redirected to the website of the sender of the newsletter and may enter your e-mail and the reasons why you unsubscribe.
Hope I could help :)
it may be a number in the textbox like number of persons ,and it save
to a web server . can we do that ?
In pure e-mail based on HTML and JavaScript? No. You can't. You need PHP to send response to server and this is not allowed in e-mails and with JavaScript is basically impossible to do it. next problem is, that you cant use iframe or something like this, because Gmail and other e-mail clients don't allow it.
But how?
You can create good looking button with HTML/CSS and on it add link to answer to your page, where you can easily process user data. If you haven't got many programming skills you can use Google Forms. Google Forms is easy to use for any user and you can create your own form without having server, because all data will save at google for free
+ it have API.
Plus Google Forms have function for sending forms via e-mail!
(Sorry for Czech in image.)
Good luck!

Email Using HTML and JavaScript

I am trying to create webpage where user can entered its detail like first name, last name, address and phone number. Once they have entered details and click on Send button it should send email to my email address and it should redirect to another page.
I am able to send email using mailto:email#gmail.com but it opens outlook with user details and then they need to click on send button to send email. I don't want outlook to be open and it should directly send email when they click on send button on form.
I am using JavaScript for validation and basic HTML tag to create form. Can anyone help me how to send email directly using HTML/JavaScript?
Thanks.
No, it is not possible to send an email with just JavaScript and HTML, you'll need some server side code to use a mailing protocol to send it out automatically. If you have web server setup you can then a server side language like PHP to create a script to send the data, see http://php.net/manual/en/function.mail.php.
There is no reliable way to send an email using client side code.
You need to submit the data to a server and process it with a server side program.
You can't send an email directly from client-side HTML/JS. You need to do it on the server.
As everyone else has said, you can't send email from the client side. However, you can use JavaScript to call a server-side script using an XMLHttpRequest, or jsonp if you're restricted by the same origin policy.
If you're new to serverside scripting, I'd suggest checking out PHP and its mail() function.

Send mail through client-side without launching an e-mail client (Silent email)

I want to send the email for html page. Is there any method to send the email silently i.e without opening the email client.
Can i have some method/way to do this using javascript or jquery ??
In this html page I dont want to show the client that any email is sending.
Any any help????
This isn't possible. And even if it was, it wouldn't be a cool thing to do.
If you want to send a web page via email why not just ask the user for their email address and then send it yourself server-side? You can use Ajax if you don't want to have a page refresh be required for this to work.
It is possible. SquareSend is one example. MailerJs is another. You only embed a tiny javascript in your webpage and you do not need a server.

HTML Website, Email issues

Hi I need some code to send e-mail directly with javascript, without load the information on a outlook server, or any other email server.
I am using HTML as its a static website. Is there any way to achieve this or do I have to move to asp.net just to get the system.mail library.
Any help will be highly appreciated.
Regards
No, in javascript all you can do is to open the mail client (if any).
To send a mail directly you must use a server side language
IF you don't have server side access to a mail server, and if it's about sending a form / feedback, on plain html you can use a 3rd party email form system. There are numerous companies who offer free email forms, you submit the html form to their server, and they send the form to the address you wish.
For example, you can try this one: http://www.emailmeform.com/
You have different options, unfortunately no one fits perfectly your definition
you can use a third party email form system. You basically set up a contact form (fields, tos, ccs...) that is than loaded to your page.
You call a server-side method that is managing your request (so you should go for ASP.NET or any other server side language)
You have a WebService way to contact your mail server and submit email requests, than you'll just need an ajax call to perform the operation
Call the user mail client (i.e Outlook, Thunderbird)
There is no way to do it in client side without calling the user mail client (i.e Outlook, Thunderbird). You can use asp.net or PHP for this issue.
Email functionality is a server-side function. So, yes, you will need to revert to a server-side technology like asp.net.
How about using ajax controls? that way you can give the impression of "client-side" emailing without page flicker.

Categories