Sending a pdf attachment from site on button click without mailto spam - javascript

So, I have a site where I'd like users to send a document (preferably) a pdf file or word doc on button click to a specific email address.
I read that mailto is not a good way to do it because of all the potential spam thats possible from spambots. Disassembling and reassembling the email address doesn't seem that hard to crack either. I don't understand how encoding works so I'd be grateful if someone explains that.
What I would like is: when the user clicks the send button, it opens up an email client with the address of the recipient and of course the mail client would have the ability to send attachments. Whats a good way spam protected way to do this?

The mailto protocol does not include attachments. And it would be a huge security issue as well. Some Outlook-related examples can be found on the internet, but in the case it has been working in the past, it is not possible nowadays and at least not platform independent in every case.

You can't send files with mailto. What you should do instead, which would also protect you from spam bots, is upload the file to your server and send the mail with the attached file from there.

Related

Is there a way to instantly send an e-mail using "mailto" in CSS (or any language-related to web development) without opening Outlook or Apple Mail?

I'm trying to create a personal website that has a contact form -- message box, for example -- but whenever I click submit or send, it opens up my Outlook e-mail, collects all the data I wrote down and then I have to click send again in Outlook to finally deliver that e-mail to someone. I'm new to webDev, so I'm just wondering if it's possible.
mailto: URLs are very unreliable and (when they work) always interact with the mail client on the user's machine.
Any solution involving submitting a form to a web server and sending email using server-side programming won't.
Use a server-side solution. Third-party hosted options exist if you don't want to do any server-side programming yourself.
The way to do this is to use a form to send data to your server. Your server then connects to an SMTP server to send the email.
If web pages could send emails on behalf of people without interaction, this would be used for spam.
It is not possible to directly send email from the web browser, whether it is CSS, HTML, nor Javascript.
I'm assuming that you'd like a contact page which would allow anyone visiting to fill in a small form which notifies you by email when they submit it?
unfortunately, this isn't possible using only css, html or javascript - which are the tools available to you in the web browser.
If you're willing to go a little deeper, then this is entirely possible given a server-side application. It's common to do this kind of thing in PHP, but any server-side language would be able to do this. You would need to do some set-up if you wanted to do it yourself, things like setting up a mail server to send outgoing mail. These things can be tricky. I'm sure that there are also many hosted options available, but I'm afraid I don't know of any.

open the user's client with attachment

I have below code to send an email from browser client.
Send Mail
However, I am looking for an email app (Outlook) which should pop up with recipient, text and attachment. After that, all that is left to do for me is pressing "send" in my outlook.
I've been trying for a while, but I couldn't find a solution. Any help would be appreciated.
While Recipients, Subject and Body are supported in the RFC mailto url syntax and implemented by some clients (please note the correct encoding and escaping of special characters like spaces), Attachments are not supported at all.
That would be difficult also, how would you know which (local) file path to pick? Also, the client would open up a potential security risk.

Send Email through Javascript/HTML using user client

I know this question has been somewhat answered already in that using client-side scripting does not send emails, but please bear with me. I would like to have a 'send email' form on my website. The thing is that the website will be used by a handful of people who do have an email client installed. So I DO want to use their installed client, but I don't want the client to pop up. Is it possible to have the client do the work and send the email in the background, or must it popup every time?
If it is not possible, can anyone direct me to which server-side scripting language would be the most efficient at emailing a form? And if there are any relevant online tutorials on the matter?
Thanks for your time

Is there a way I can have my website send an email without executing a script

I want to add a contact page on my webpage. However, I'm apparently not allowed to execute a script on my site since it's hosted on a protected school server.
Is there a work-around where I could send an email on the client side? (maybe some ajax trick?)
All I've found so far is a way to use javascript to open the default mail client and prefill all the data. However, I don't really like that. I'd really like a way to send an email directly from my site. I was even thinking that I could create a java applet to create my email page if that's possible.
There is no way to send an E-Mail from the client without the user's consent.
It would be a horrendous security problem if it were possible.
You could make use of a remote form mailing service like FormToEmail, though.

javascript - send email through outlook

Can i send a pdf file through javascript ?
i have a link ,when i click the link it need to open OUTLOOK with title and the pdf file as attachment.also some body text.
Is it possible ?
Thank you .
Security restrictions will not allow this. Imagine the potential issues.
Also, you have absolutely no control over which email client is opened. This is set by the user for whatever operating system they are using.
Since it is not possible I suggest gathering all the information you need from your page (subject, body, which file, etc.) and submitting that to your server for processing. On the server you can send your e-mail using smtp.
Since adding the PDF as an attachment is not possible, I would recommend putting the link to it in the email body. This will save on the user's bandwidth and can be done with a simple mailto: link.
Send PDF
This will also work on any system with whatever email client the user has as their default (i.e. you're not limited to Outlook).

Categories