I'm familiar with the limits and uses of the mailto link. It's pretty handy, but of course, my client would like to manipulate the body more than plain text will accommodate.
I've seen questions like this one: Send HTML code to Body of email application
But I want to expand on it. I can restrict my users to iPad and Outlook 2016+. So I wanted to know if there is a way to directly interact with apple mail and Outlook from a web app to generate a "pretty" email. I can detect if user is on iPad or not and run disparate code if needed for the two platforms.
I can even entertain throwing a server in the middle, but it's important that email ultimately opens on the client for additional personalization.
Thanks,
Wayne
Related
I don't really know if it is possible but I am creating a catalog in indesign using in5 plugin which converts the indesign in HTML using javascript and jQuery. In each page of that catalog have 6 products.
How can I make a button that, when clicked, opens the email client app (for example, Outlook) with the PDF of the specs and technical drawings of the product attached?
Please help me or point me in the right way.
Thank You
Honestly, if you want options on who you send the email to and what it contains,
there's no magic HTML button that's going to just send an email for you.
If you plan on using JavaScript you should probably learn how to use NodeJS and the Nodemailer module.
This will allow you to set up a server with which to create and send emails from on your site, not just open a pre-existing client.
Here's what you might want to see to get started.
https://youtu.be/nF9g1825mwk
Then when it comes to Nodemailer use this one because the last video is outdated.
https://www.youtube.com/watch?v=h7wH7aEb8Ok
I don't know if this is quite accurate, but attempt this:
Make the button, so that it has a hyper reference(href) to the link to the app . You can use a container to send a message.
You can include a link to the pdf.
We are using zapier's webhooks to collect answers we gather via html5 formatted mail messages. The mail is created with zapier and includes some dynamic info and two buttons to make your choice. These button actions are each linked to a different webhook. The webhook provided by zapier has a static part and a dynamic part which is a zapier variable. When the receiver pushes the button, a blank browser window shows up with, whether a short text or in "silent mode" a blank page.
Although we are sending an extra mail as confirmation for the decision made via mail, we would like to either avoid the showing of this blank page at all or maybe replace it by a customized HTML page that shows a more attractive web page.
We tried different approaches like using an additional javascript onlick action on the button to achieve the opening of two pages with one click. One with the webhook blank page as the trigger and another one with a nice confirmation message page for a nice user experience. Unfortunately, there are some mail client limitations that seems not to allow javascript executions.
Is there any workaround like using any third-party service that offers webhook containers with the possibility to customize the content of the page linked to the webhook URL or any idea on how to link a button action to two url’s?
Thank you for reading this long question. Any help would be greatly appreciated.
David here, from the Zapier Platform team.
I can't speak to other options, but the best choice for you here is probably to have the email link go to a static page with two buttons. That way, you'll be in the browser and can do whatever you need with JS. This is likely buttons that have onClick handlers and then show nice confirmations.
It also avoids false clicks, where a mail client tries to load external resources (which normally doesn't matter, but in this case can trigger a webhook).
I have a chat system and I want to protect my users from malicious websites, and sometimes people sends a URL through the chat system, and users click on it and access some scam sites. I have that protect page like redirect.php?url=someurl.com that alerts the users that URL can be a malicious website, and the users have to click on Continue button to access the link. But I want to give them one more option which is See a preview, and clicking on it, a new tab will be opened with a screenshot, or if it's not possible only with PHP and Javascript, show a clean version of the page without Javascript.
How can I do this?
I'm planning of make use of file_get_contents(), save it to some preview text, cleaning the <script> tag of the page, but it'll be enough?
Lots of such screen capture web service here:
What's the best website screenshot capture API?
But instead of doing that by yourself, I think you should go with those many public link-shortening service, like t.co, because anti-malicious is already one of their purpose:
Having a link shortener protects users from malicious sites that
engage in spreading malware, phishing attacks, and other harmful
activity. A link converted by Twitter’s link service is checked
against a list of potentially dangerous sites. Users are warned with
the error message below when clicking on potentially harmful URLs.
Try this solution :): html2canvas
[outofdate] http://html2canvas.hertzen.com/screenshots.html
--
Update: http://html2canvas.hertzen.com
I am building a website for a customer who may not be very computer literate. This person knows how to use email. How can I build a website (purely html, javascript) where he can email his latest prices and the website automatically updates itself. I dont think he would be literate enough to FTP file some where. Is it possible?
How to build a secure login page and redirect to order page using only javascript and html?
How to create secure administrative section on javascript/html only website?
I would advise you to create a nice admin web interface, and teach him how to use it. Or, agree some kind of Excel format for product prices, and teach the steps of uploading a csv file. Doing things by email would complicate things in my opinion.
As in the website receives the email as data input? That's probably not going to work very well. Also, if the client is as you imply, expect those emails to be poorly formatted, filled with typos, etc. It's not a very good data entry medium by any means.
The ideal solution would be to build an admin page into the website where the client can enter the information in as controlled a manner as possible, validating the information on the spot rather than through an email (would the server send a reply email for invalid data? that would get infuriating quickly). A simple and intuitive UI should be able to overcome any computer literacy issues he may have.
I don't think this can be done purely in HTML/Javascript. It would need a server component. You would have to set up some sort of POP3 or IMAP listener that polls a mail server for correctly formatted email then dumps that into a database to update the site. Certainly not trivial.
I would build an administration portion of the site to allow the customer to log in and enter the data...no matter how illiterate, they certainly can be trained. ;-)
You could make the mail your prices thing work by just regulary checking a specific mailbox (over POP3 for example).
But that's something you won't be able to do in only pure html / javascript (and consider this: you would also need to store the mailbox credentials in client side code then!)
Email is a store-and-forward, asynchronous transport. You can use it to transport:
plain text (the body of an email)
styled text (the html body of a MIME email)
attached files
But none of those options will work well in your use case. You'd have to try to parse the body of the email if you were looking in the body for update information. -- Bad idea
And if you're using email to transport ordered data such as csv or Excel files, uploading the files directly to the website would enable a much better user interface.
You shouldn't use Excel files either since it will be too complicated for your user--he'd need to get the column (field) names exactly right, the content cells would also need to be exactly right, etc. Eg I use an excel file for input on one of my systems and a constant problem is zip/postal codes since they look like numbers but can have significant leading zeroes. Few users know how to enter them...
Recommendation create a set of web forms in the administrative section of the website. Your customer will be happy and you'll be even happier due to lower volume of support calls.
I want to email a web page through javascript. Its enough to open the outlook new mail option. I try to move a Here i am using mailto: option in html.
Actually i am try to create a dynamic email template and want to send that template in html format.
Its showing error "comment line argument is not valid. verify the switch you are using"
please get me the solution.
Javascript can't send e-mails. Your best bet is the e-mail me syntax. There is a convention that most browsers suppors that lets you set the contents of various attributes as well.
e-mail me
It will have to be URL encoded, and as far as I know, there is no reliable way to pass HTML. You have to assume plain text emails.
You really need the server's help to make this easier.
1) Have the server make an XMLHTTP request to the page that generates the HTML you want. Grab it and make it the mail body.
or -
2) Grab the innerHTML, stick it in a hidden textarea and post it back to the server. Use the posted form field in the mail body.
You need to do this server-side, not client side. Outlook is not going to allow you the control you need to use a template. And for good reason - you wouldn't want websites taking control over your Outlook and sending emails.
If you can tell us what server you're using, we can show you how to send the email server-side.
There are security restrictions which stop it working directly. Yes if you wanted Outlook specifically, you could start messing with ActiveX - but that is fiddly and limited certain operating systems , installations, and security settings.
It is much better to use a mailto: URL. This is then cross-platform, and supports any default mail client.