mailto link for large bodies
Asked Answered
O

2

13

I have a page upon which a user can choose up to many different paragraphs. When the link is clicked (or button), an email will open up and put all those paragraphs into the body of the email, address it, and fill in the subject. However, the text can be too long for a mailto link.

Any way around this?


We were thinking about having an SP from the SQL Server do it but the user needs a nice way of 'seeing' the email before they blast 50 executive level employees with items that shouldn't be sent...and of course there's the whole thing about doing IT for IT rather than doing software programming. 80(

When you build stuff for IT, it doesn't (some say shouldn't) have to be pretty just functional. In other words, this isn't the dogfood we wake it's just the dog food we have to eat.


We started talking about it and decided that the 'mail form' would give us exactly what we are looking for.

  1. A very different look to let the user know that the gun is loaded and aimed.
  2. The ability to change/add text to the email.
  3. Send a copy to themselves or not.
  4. Can be coded quickly.
Overpass answered 8/8, 2008 at 12:40 Comment(1)
The max link length in Chrome appears to be 2027 according to the JS script in this answer: https://mcmap.net/q/346522/-effective-maximum-mailto-body-lengthsKilmarx
T
15

By putting the data into a form, I was able to make the body around 1800 characters long before the form stopped working.

The code looked like this:

<form action="mailto:[email protected]">
    <input type="hidden" name="Subject" value="Email subject">
    <input type="hidden" name="Body" value="Email body">
    <input type="submit">
</form>

Edit: The best way to send emails from a web application is of course to do just that, send it directly from the web application, instead of relying on the users mailprogram. As you've discovered, the protocol for sending information to that program is limited, but with a server-based solution you would of course not have those limitations.

Thermopylae answered 8/8, 2008 at 12:47 Comment(3)
Using a form is no better than using a long URL encoded link, and in fact appears to be worse (less characters).Kilmarx
Actually this solution replaces splaces with + symbol.Champollion
I created sample solution on codepen. please check this link -> codepen.io/akashgudadhe1/pen/ZEvPGXxChampollion
M
0

Does the e-mail content need to be in the e-mail? Could you store the large content somewhere centrally (file-share/FTP site) then just send a link to the content?

This makes the recipient have an extra step, but you have a consistent e-mail size, so won't run into reliability problems due to unexpectedly large or excessive content.

Matamoros answered 8/8, 2008 at 12:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.