Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #16449

Re: Sending email with attachments

Message-ID <79399539.ZlHCqS61bk@PointedEars.de> (permalink)
From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Organization PointedEars Software (PES)
Date 2012-10-07 18:55 +0200
Subject Re: Sending email with attachments
Newsgroups comp.lang.javascript
References (1 earlier) <2610175.x4FWaXcEle@PointedEars.de> <i-mdne2bX43RGfLNnZ2dnUVZ_hidnZ2d@earthlink.com> <7238984.617k9mAqVa@PointedEars.de> <iZSdnZOJXZQ0G-3NnZ2dnUVZ_vqdnZ2d@earthlink.com> <k4rmj2$vqj$1@news.albasani.net>
Followup-To comp.lang.javascript

Followups directed to: comp.lang.javascript

Show all headers | View raw


Stefan Weiss wrote:

> On 2012-10-06 21:29, Patricia Shanahan wrote:
>> I could install scripts in my personal domain, but I don't think users
>> would want their data to go through my domain.
> 
> They're already trusting your app to handle their data properly, so why
> would they worry about the forwarding server? In the usual case, the
> script doing the web-to-mail forwarding will be a very simple affair.
> You can make it available as an open source download for those who do
> have a server, and provide forwarding on own server as a (free?) service.

She has explained that her users and the organizations they belong to are 
usually neither willing nor capable of running a server-side script.
 
> I think sending attachments by email with JS alone (from an HTML
> document in a browser) is a lost cause, especially if it has to work on
> as many clients as possible. It's not that the language is too limited,
> the problem is that browsers don't usually expose that kind of
> functionality to scripts (and for good reason).

Is that so?  I have not found a single Web browser that, if an e-mail client 
is installed and configured on the same system, does not support code of the 
form

  window.location = "mailto:foo@bar?subject=baz&body=bla";

And as for mobile devices which are the primary concern here, I have found 
that to work in various browsers and with various e-mail apps both on iOS 
4.2.1 and Android 4.0.3 both with `http:' and (on Android, the equivalent 
of) `file:'.  I would be surprised if it did not work elsewhere, such as 
newer OS versions and on Windows Mobile.  (There are other mobile OSes, but 
the application requirements can reasonably state that they are not actively 
supported, given the current and projected combined market share of the 
aforementioned ones).

The actual limitation here is twofold: URI length and e-mail client.  If the 
data can be encoded so that it fits within about 447 octets in the worst 
case – scheme (7) + address (20) + subject (9 + 20) + body (6 + 447) = 
MSHTML maximum (509) – for a stream of ASCII characters without control 
characters except perhaps CR and LF, and if there is an e-mail client 
installed and configured on the same system, then this can be done using a 
plain-text e-mail.  For the desktop system where the e-mail is being 
retrieved to later can provide the data decoding service.

Testcase: <http://PointedEars.de/scripts/test/dom/mailto>

> Even Java applets can't send emails to random SMTP servers. In theory,
> they'd be powerful enough (for example with JavaMail, or by just opening
> a socket and speaking SMTP directly), but the default security
> restrictions will prevent them from connecting to anything but the
> originating host.

You do not have to send the e-mail from the browser.

> From what I understand about your project, you have two options: the
> HTML+JS approach you described plus a server-side component, or you bite
> the bullet and build native apps for each target platform. You could
> still do most of the layout/navigation parts in HTML+JS, but your app
> will have to handle the email part.

Neither one may be necessary.


PointedEars
-- 
Danny Goodman's books are out of date and teach practices that are
positively harmful for cross-browser scripting.
  -- Richard Cornford, cljs, <cife6q$253$1$8300dec7@news.demon.co.uk> (2004)

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Sending email with attachments Patricia Shanahan <pats@acm.org> - 2012-10-01 22:49 -0700
  Re: Sending email with attachments Scott Sauyet <scott.sauyet@gmail.com> - 2012-10-02 04:20 -0700
    Re: Sending email with attachments Scott Sauyet <scott.sauyet@gmail.com> - 2012-10-02 05:16 -0700
      Re: Sending email with attachments Patricia Shanahan <pats@acm.org> - 2012-10-02 07:10 -0700
        Re: Sending email with attachments Scott Sauyet <scott.sauyet@gmail.com> - 2012-10-02 10:57 -0700
    Re: Sending email with attachments Patricia Shanahan <pats@acm.org> - 2012-10-02 07:03 -0700
      Re: Sending email with attachments Scott Sauyet <scott.sauyet@gmail.com> - 2012-10-02 10:50 -0700
        Re: Sending email with attachments Patricia Shanahan <pats@acm.org> - 2012-10-02 11:16 -0700
          Re: Sending email with attachments dann90038@gmail.com - 2012-10-02 12:15 -0700
      Re: Sending email with attachments "Tom de Neef" <tdeneef@qolor.nl> - 2012-10-02 21:28 +0200
        Re: Sending email with attachments Patricia Shanahan <pats@acm.org> - 2012-10-02 12:59 -0700
  Re: Sending email with attachments Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-10-02 22:26 +0200
    Re: Sending email with attachments Patricia Shanahan <pats@acm.org> - 2012-10-03 20:04 +0100
    Re: Sending email with attachments Patricia Shanahan <pats@acm.org> - 2012-10-06 02:07 +0100
      Re: Sending email with attachments Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-10-06 08:48 +0200
        Re: Sending email with attachments Patricia Shanahan <pats@acm.org> - 2012-10-06 20:29 +0100
          Re: Sending email with attachments Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-10-06 21:49 +0200
            Re: Sending email with attachments Patricia Shanahan <pats@acm.org> - 2012-10-07 08:13 +0100
              Re: Sending email with attachments Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-10-07 14:28 +0200
                Re: Sending email with attachments Patricia Shanahan <pats@acm.org> - 2012-10-08 00:43 +0100
                Re: Sending email with attachments Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-10-08 03:26 +0200
                Re: Sending email with attachments Patricia Shanahan <pats@acm.org> - 2012-10-08 07:18 +0100
                Re: Sending email with attachments Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-10-08 11:13 +0200
                Re: Sending email with attachments Patricia Shanahan <pats@acm.org> - 2012-10-08 18:57 +0100
                Re: Sending email with attachments Patricia Shanahan <pats@acm.org> - 2012-10-08 09:46 +0100
                Re: Sending email with attachments Erwin Moller <erwinmollerusenet@xs4all.nl> - 2012-10-08 12:01 +0200
                Re: Sending email with attachments Patricia Shanahan <pats@acm.org> - 2012-10-08 19:16 +0100
                Re: Sending email with attachments Gene Wirchenko <genew@ocis.net> - 2012-10-08 09:28 -0700
                Re: Sending email with attachments Patricia Shanahan <pats@acm.org> - 2012-10-08 18:34 +0100
          Re: Sending email with attachments Stefan Weiss <krewecherl@gmail.com> - 2012-10-07 12:46 +0200
            Re: Sending email with attachments Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-10-07 18:55 +0200
              Re: Sending email with attachments Stefan Weiss <krewecherl@gmail.com> - 2012-10-07 20:06 +0200
                Re: Sending email with attachments Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-10-07 22:12 +0200
            Re: Sending email with attachments Patricia Shanahan <pats@acm.org> - 2012-10-07 19:54 +0100
            Re: Sending email with attachments Patricia Shanahan <pats@acm.org> - 2012-10-08 01:09 +0100
              Re: Sending email with attachments Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-10-08 13:10 +0200
                Re: Sending email with attachments Patricia Shanahan <pats@acm.org> - 2012-10-08 19:20 +0100
              OT: Mac vs PC for development  (Was: Sending email with attachments) Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-10-08 08:38 -0700
  Re: Sending email with attachments Dr J R Stockton <reply1240@merlyn.demon.co.uk.invalid> - 2012-10-03 19:49 +0100
    Re: Sending email with attachments Eli the Bearded <*@eli.users.panix.com> - 2012-10-03 23:08 +0000
      Re: Sending email with attachments Patricia Shanahan <pats@acm.org> - 2012-10-04 02:46 +0100
        Re: Sending email with attachments Scott Sauyet <scott.sauyet@gmail.com> - 2012-10-03 19:42 -0700
    Re: Sending email with attachments Patricia Shanahan <pats@acm.org> - 2012-10-04 02:43 +0100
      Re: Sending email with attachments Scott Sauyet <scott.sauyet@gmail.com> - 2012-10-03 19:54 -0700

csiph-web