Using HTML and JS, I have developed a website that has multiple items in different pages with an "add to cart" button. I can link these to appear in the "cart" page but I don't want customers to pay just yet, I want customers to be able to click a button and make an order that will be sent out to us and we can process the order. I have tried to use the email tag for HTML:
<a href = "mailto:delicatedesigns#gmail.com?subject = Order&body = itemsInCart
</a>
Is there a way to include the contents of my cart page as the body of that email? if not, is there a plug in that would work well to make this happen?
You can send the list to the backend and setup a mail server using SMTP and then create a mail template that can be used to send the mail through the SMTP server.
Attach the list to the template and send the mail to the destination address using the SMTP server.
If you are using Java, try using the Java Mail API. This can help you set up an SMTP Server easily
Related
I'm building a shooping site where the customer is ablee to contact the seller with emails.
I dont want to use backend so I just use Mailto.
now, I have 2 questions:
1) Can I open the client mail with disabled field?
So that he wont be able to change the "To" field (for example)?
I dont want to use "readonly" attribute because there are also fields that the user himself need to fill.
2) Can I send the mail from my code without the customer press "send"?
Thank you guys!
Can I open the client mail with disabled field?
No.
Can I send the mail from my code without the customer press "send"?
No.
If you want to do that, then use server-side code to send the email. You might want to use a backend, but you need one. It can be one you run on your websites server or a third-party service.
This question already has answers here:
How to send an email from JavaScript
(20 answers)
Closed 3 years ago.
I can use only javascirpt and jquery.
My customer said without server and using javascript and jquery can send email from gmail SMTP.
Gmail SMTP surpport only use javascript and jquery can send Email? and without server?
I want send email the mail template(html) in dynamic value (without Server!)
I tried this URL content.
https://github.com/dwyl/learn-to-send-email-via-google-script-html-no-server#how
But I have to send an e-mail with the entered ID.
This ID is dynamic value.
You can not send an email direct from front-end using JavaScript, Jquery or any front-end framework/library externally using server or back-end. because your credentials are open to all and there are so many factors work behind that...
An option is to let each user use his or her sociable mail server, by doing a mailto: connection, which allows you to define the header data & including a quasi-header called 'body', which sets the content you require to pass in the message body.
You can Send Using:-
There are also some parameters to add:
However, you can append parameters to email like the following:-
Here are some parameters you can pass in the mail you want to send from front-end
mailto:-add recipients,
note:- if you want to add multiple recipients then add comma-separated as mentioned in the example.
&cc= to add CC recipients,
&bcc= to add BCC recipients,
&subject= to add mail subject,
&body= to add mail body,
Example:-
<a href="mailto:sendMe1#example.com?cc=sendMecc#example.com?bcc=sendMebcc#example.com?subject=Mail-SubJect
&body=Mail-Body....">
Send Me Email from Front-end
</a>
Some customer-service providers provide you to send an email with the help of their service smtpjs, formspree, emailjs,
Google APIs, but this is not practical plus trusted.
I have HTML form with a textbox where user enter his email - let say to register for a newsletter and a button to join.
When clicking the button I'd like to send myself an email with a constant subject like: 'a new user joined your newsletter' and in the body of the email have the text entered by the user.
So with PHP and Javascript code its possible - i'm looking for a pure html code that does the same (in my index.html file)
using <a href: mailto...> or <form action=mailto:... method=post> or <button onclick:mailto...> opens my mail application :(
Is there a way to send that email in the background (without opening the mail application) with the data from textbox in the email body?
if Yes to Q.1 then is there a way to add a fixed subject
No, there is no way you can send email using pure html. Email is sent over SMTP protocol. A browser operates in HTTP protocol. So it's not possible to send email even using pure javascript. Only server can send data using SMTP protocol.
No because you can not send an E-Mail without using an SMTP server. This server must be contacted by PHP or another server-side script (server must receive a form request and process it). You can not contact a SMTP server via pure HTML (that would be really insecure btw).
Regarding mailto: This only works if your clients have installed a mail client on their local machine. This mail client must be properly configured in order to - guess what - contact an SMTP server in order to send the mail.
However it is possible passing a subject via mailto:
https://css-tricks.com/snippets/html/mailto-links/
I would like to generate an email with two buttons approve / decline.
On clicking those buttons in the email body , make a call to my web service
I have the js written that uses jsonp to send a CORS request and am happy that works correctly
When embedding the html in the email body, it does nothing , I don't even see the button.. just text
I'm wondering is this scenario even possible or is there another route I should be taking
AJAX Requests cannot be made from Email Clients. They simply don't support that kind of functionality.
Consider
Generating two separate Web site URLs for Approve and Decline which
show a action success message for either actions respectively.
Or Send the URL for the page that you just created through the mail and let the ajax request take responsibility from there.
Any idea how to launch lotus notes from javascript and attach a document to a new mail programmatically. I know many will find it absurd.. but my stake holders seem to have a fascination with impossible feats!
could it be done via an xPage?
You can actually extend the mailto url abit and get a subject, body text and an attachment too
mailto:someone#example.com?subject=my new email&body=attachment below&attachment=c:\temp\thefile.txt
The attachment must be stored on a drive that the machine can access it's not and url.
And you might need double slashes.
If Lotus Notes is the default mail client (which it usually is if its an enterprise environment), then all you need to do is create a mailto: link.
For example:
Send email
This can be customised to include a subject or a body, and when clicked in a webpage will launch the default mail client and which should then populate form.