Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Sending email with attachments
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  Messages 1 - 25 of 44 - Collapse all  -  Translate all to Translated (View all originals)   Newer >
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Patricia Shanahan  
View profile  
 More options Oct 2 2012, 1:49 am
Newsgroups: comp.lang.javascript
From: Patricia Shanahan <p...@acm.org>
Date: Mon, 01 Oct 2012 22:49:04 -0700
Local: Tues, Oct 2 2012 1:49 am
Subject: Sending email with attachments
I am writing a data collection application. It needs to run on as many
tablets and laptops as possible, so I'm writing it in HTML and
JavaScript. Although I cannot ask end users to buy a particular device,
I can ask them to install an up to date browser.

The ultimate destination of the data is a spreadsheet on a workstation
controlled by the person doing the data entry, or one of their associates.

The ideal, from my end users' point of view, would be a button they
could click that would send an e-mail to an address they enter with the
data attached in .csv format. I do understand that e-mail would not be
the best way of getting the data to a web server, but that is not the
objective. Forwarding the data from my web site to a user-specified
e-mail address would require anti-spam precautions, and be generally
undesirable.

I've done web searches, and the closest I've been able to get is to fold
the data into a mailto URL as the message body, not an attachment. I
would be length limited by the Internet Explorer 2083 char URL limit,
and I think I would also have to quote URL special characters.

Another option is to just display the data and invite the user to
select and copy. The data could then be pasted into the body of an
e-mail, or into a text file in an editor window. I believe that would
work, but involves more end user busy work than is ideal.

I am very new to JavaScript, so I'm really hoping there is a better way
of doing this that I have just not found.

Thanks for any ideas or pointers to web sites I should read.

Patricia


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Scott Sauyet  
View profile  
 More options Oct 2 2012, 7:20 am
Newsgroups: comp.lang.javascript
From: Scott Sauyet <scott.sau...@gmail.com>
Date: Tue, 2 Oct 2012 04:20:27 -0700 (PDT)
Local: Tues, Oct 2 2012 7:20 am
Subject: Re: Sending email with attachments

Patricia Shanahan wrote:
> I am writing a data collection application. It needs to run on as many
> tablets and laptops as possible, so I'm writing it in HTML and
> JavaScript. Although I cannot ask end users to buy a particular device,
> I can ask them to install an up to date browser.

> The ultimate destination of the data is a spreadsheet on a workstation
> controlled by the person doing the data entry, or one of their associates.

> The ideal, from my end users' point of view, would be a button they
> could click that would send an e-mail to an address they enter with the
> data attached in .csv format. [ ... ]

I don't understand why you would choose email for this rather than a
web download.  Are the browsers working disconnected from the server
serving that content?  Is the server extremely limited?  If neither of
these is true, then you should be able to send the data to the server
to send back as a downloadable file.  That seems the most flexible
solution.  Does your infrastructure prevent this?

  -- Scott


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Scott Sauyet  
View profile  
 More options Oct 2 2012, 8:16 am
Newsgroups: comp.lang.javascript
From: Scott Sauyet <scott.sau...@gmail.com>
Date: Tue, 2 Oct 2012 05:16:39 -0700 (PDT)
Local: Tues, Oct 2 2012 8:16 am
Subject: Re: Sending email with attachments

I posted a proof of concept of this technique in a thread started by
this post:

    <news:QvydnWGOxc8p0N_WnZ2dnUVZ_tWdnZ2d@posted.isomediainc>

Google archived this thread at

    <https://groups.google.com/group/comp.lang.javascript/
browse_thread/thread/fbf0f310811f30b7/3b751ce8a7107c61>

  -- Scott


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Patricia Shanahan  
View profile  
 More options Oct 2 2012, 10:03 am
Newsgroups: comp.lang.javascript
From: Patricia Shanahan <p...@acm.org>
Date: Tue, 02 Oct 2012 07:03:50 -0700
Local: Tues, Oct 2 2012 10:03 am
Subject: Re: Sending email with attachments
On 10/2/2012 4:20 AM, Scott Sauyet wrote:

It does make it much less desirable and appropriate than e-mail
transmission.

If there were a non-browser programming language and run time
environment that ran on all target devices, including iPad, I would be
writing an application in that language. The only reason for configuring
the application as a web site is the number of possible collection
devices that have browsers with JavaScript.

The data is not my data and is none of my business. Different people
will be doing the data collection, for different projects, in different
organizations. Each project will belong to some researcher who will
typically use a workstation behind a firewall to consolidate and process
the data and prepare reports based on it.

I would like to get the data as directly as possible from the data
collection device to that workstation. The end users are expert
spreadsheet users, so they know what to do with a .csv attachment, but
are not web developers and do not necessarily control a web server. My
lead user suggested e-mail as his ideal data delivery method.

Some of the data collection will have to be done offline. I'm looking at
marking pages and JavaScript files for offline use, but would like to
also offer the application in the form of a zip file that can be
downloaded and extracted on a collection device, and used locally. I
plan to store the data in the browser's local memory until the user has
network access. Transferring data collected by local pages to my web
site gets into cross-domain access issues.

Patricia


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Patricia Shanahan  
View profile  
 More options Oct 2 2012, 10:10 am
Newsgroups: comp.lang.javascript
From: Patricia Shanahan <p...@acm.org>
Date: Tue, 02 Oct 2012 07:10:34 -0700
Local: Tues, Oct 2 2012 10:10 am
Subject: Re: Sending email with attachments
On 10/2/2012 5:16 AM, Scott Sauyet wrote:

I've looked at the thread. If I understand it correctly, it is about
getting the data to the web site serving the pages, not to an e-mail
inbox on a workstation outside that domain, my objective. I recognize
that there may be ways of forwarding the data, but I would prefer to
avoid that if there is any way of doing so.

Patricia


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Scott Sauyet  
View profile  
 More options Oct 2 2012, 1:50 pm
Newsgroups: comp.lang.javascript
From: Scott Sauyet <scott.sau...@gmail.com>
Date: Tue, 2 Oct 2012 10:50:36 -0700 (PDT)
Local: Tues, Oct 2 2012 1:50 pm
Subject: Re: Sending email with attachments

I see.  I did misunderstand the problem.  I don't think you will be
able to do what you would like.  Client-side Javascript has no
capability to email.  `mailto:` links are just ways to launch external
email programs, and there is no way that I know of to add attachments
to those emails.

I wish I had better news for you.  Best of luck,

  -- Scott


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Scott Sauyet  
View profile  
 More options Oct 2 2012, 1:57 pm
Newsgroups: comp.lang.javascript
From: Scott Sauyet <scott.sau...@gmail.com>
Date: Tue, 2 Oct 2012 10:57:00 -0700 (PDT)
Subject: Re: Sending email with attachments

You are correct.  This is an example of how you can do web downloads
from client-side code with a minimally cooperative server, not how to
do any email.  It will not work at all in an off-line environment, and
it does require that the users trust the server not to do anything
more with the data than to return it as a download.

I wish I had a suggestion that might help with your original problem,
but I don't know of anything.  My best suggestion would be to write
something that you could compile for each of your target
environments.  If you want client-side Javascript, you might try
something that supplies its UI over HTTP and then launch a browser
pointing to a local host, but even then you would need to write that
host in something that you could deploy natively to your target
machines.  Sorry.

  -- Scott


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Patricia Shanahan  
View profile  
 More options Oct 2 2012, 2:16 pm
Newsgroups: comp.lang.javascript
From: Patricia Shanahan <p...@acm.org>
Date: Tue, 02 Oct 2012 11:16:38 -0700
Local: Tues, Oct 2 2012 2:16 pm
Subject: Re: Sending email with attachments
On 10/2/2012 10:50 AM, Scott Sauyet wrote:

> Patricia Shanahan wrote:
...
>> If there were a non-browser programming language and run time
>> environment that ran on all target devices, including iPad, I would be
>> writing an application in that language. The only reason for configuring
>> the application as a web site is the number of possible collection
>> devices that have browsers with JavaScript.

> I see.  I did misunderstand the problem.  I don't think you will be
> able to do what you would like.  Client-side Javascript has no
> capability to email.  `mailto:` links are just ways to launch external
> email programs, and there is no way that I know of to add attachments
> to those emails.

> I wish I had better news for you.  Best of luck,

Thanks. Even a negative result is very helpful. I would otherwise have
spent a lot of time web searching and experimenting looking for
something that does not exist. It is relatively easy to find how to do
something that can be done in an unfamiliar language. Being sure
something cannot be done is much harder.

I do have a fall-back position that would have to be used to in some
situations. I plan to provide a way to display the data in a text area,
ideally already selected, so that the user can copy it to the clipboard.
Once it is in the clipboard it can be pasted into an e-mail, Google docs
text file, text file on a thumb drive etc. etc.

I have to support that anyway for devices that do not have an e-mail
client, and for confidential data that should not be sent over the
Internet in unencrypted form.

Patricia


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
dann90...@gmail.com  
View profile  
 More options Oct 2 2012, 3:15 pm
Newsgroups: comp.lang.javascript
From: dann90...@gmail.com
Date: Tue, 2 Oct 2012 12:15:00 -0700 (PDT)
Subject: Re: Sending email with attachments
js or html cannot send an e-mail as an engine from the browser, true, however a mail-server on the server side can do the sending, if the webpage just provides the FORM with a method say method="post" and can also take file(s) <input type="file" ...> input to be send over on with enctype="multipar/form-data" in the FORM.  The only thing needed for all that will be the mail-server service on the server side and the script to process it.

<form action="SPREADSHEET_SENDER.pl" method="POST" enctype="multipart/form-data">
  <input type="file" name="data-collection">
  .....
</form>

    Danny


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tom de Neef  
View profile  
 More options Oct 2 2012, 3:28 pm
Newsgroups: comp.lang.javascript
From: "Tom de Neef" <tden...@qolor.nl>
Date: Tue, 2 Oct 2012 21:28:58 +0200
Local: Tues, Oct 2 2012 3:28 pm
Subject: Re: Sending email with attachments

Forgive if I got it wrong: data is collected on devices with internet access
and browser support.
This data is in the form of tables or files and needs to be sent to someone
with an email account, where the account depends on the device/data under
consideration. You would like to get it there 'as direct as possible'.

Suppose you had a web server. The person operating the collection device
surfs to its URL. He gets a webpage with two selection 'fields': one to
indicate where the data is (when it is a file) or to copy it into a text
field (when it is a table). The other to select the email address of the
target person. Any pre-processing (like getting the data in the right
format) could be done by script on the page.
'Submit' could then result in an (encrypted) upload to the server, where the
data is attached to an email which the server sends to the target.
Would that meet your requirements? It would be easy to implement.
Tom


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Patricia Shanahan  
View profile  
 More options Oct 2 2012, 3:59 pm
Newsgroups: comp.lang.javascript
From: Patricia Shanahan <p...@acm.org>
Date: Tue, 02 Oct 2012 12:59:55 -0700
Local: Tues, Oct 2 2012 3:59 pm
Subject: Re: Sending email with attachments
On 10/2/2012 12:28 PM, Tom de Neef wrote:

Typically, the data will be in the browser's local storage, where I can
put it from client-side JavaScript. However, the main point is that the
data will be somewhere accessible to my client side code.

> Suppose you had a web server. The person operating the collection device
> surfs to its URL. He gets a webpage with two selection 'fields': one to
> indicate where the data is (when it is a file) or to copy it into a text
> field (when it is a table). The other to select the email address of the
> target person. Any pre-processing (like getting the data in the right
> format) could be done by script on the page.
> 'Submit' could then result in an (encrypted) upload to the server, where the
> data is attached to an email which the server sends to the target.
> Would that meet your requirements? It would be easy to implement.

How safe would that be from spammers wanting to turn my web site into a
forwarding engine?

Patricia


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Thomas 'PointedEars' Lahn  
View profile  
 More options Oct 2 2012, 4:26 pm
Newsgroups: comp.lang.javascript
Followup-To: comp.lang.javascript
From: Thomas 'PointedEars' Lahn <PointedE...@web.de>
Date: Tue, 02 Oct 2012 22:26:18 +0200
Local: Tues, Oct 2 2012 4:26 pm
Subject: Re: Sending email with attachments

Patricia Shanahan wrote:
> I am writing a data collection application. It needs to run on as many
> tablets and laptops as possible, so I'm writing it in HTML and
> JavaScript. Although I cannot ask end users to buy a particular device,
> I can ask them to install an up to date browser.

> The ultimate destination of the data is a spreadsheet on a workstation
> controlled by the person doing the data entry, or one of their associates.

> The ideal, from my end users' point of view, would be a button they
> could click that would send an e-mail to an address they enter with the
> data attached in .csv format.

You cannot do that client-side, so you will have to do it server-side.  That
is, have a server-side application compile the .csv and send the e-mail.  
Usually that would be the same server-side application that generated the
client-side application in the first place.

> I do understand that e-mail would not be the best way of getting the data
> to a web server, but that is not the objective. Forwarding the data from
> my web site to a user-specified e-mail address would require anti-spam
> precautions, and be generally undesirable.

If that is a concern, users of the application need to be authenticated
before they can use that function (see also [OWASP]).

Only shifting the load from the server to the client is not a solution.  In
fact, it has the potential to make matters worse.  Client computers
(including mobile devices) are usually much less protected, thus more easily
compromised, than servers.

> I've done web searches, and the closest I've been able to get is to fold
> the data into a mailto URL as the message body, not an attachment.

Technically, an e-mail attachment is a part of the message body of a multi-
part message, following a delimiter line, own header and usually a Base64-
encoded message-part body (see [RFC2046]); so, in theory, it could work.  
But I would not recommend it for production.  In fact, security measures
might prevent it.

> I would be length limited by the Internet Explorer 2083 char URL limit,
> and I think I would also have to quote URL special characters.

Apparently there are exceptions for certain supported URI schemes, such as
`data:'. [SO]  There might be one for `mailto:' as well.  However, a
suitable MUA will need to be installed and configured at the client for this
to work, which you should not make a requirement.

> Another option is to just display the data and invite the user to
> select and copy. The data could then be pasted into the body of an
> e-mail, or into a text file in an editor window. I believe that would
> work, but involves more end user busy work than is ideal.

Yes, in a Web application you should make best use of the *Web* first.

> I am very new to JavaScript, so I'm really hoping there is a better way
> of doing this that I have just not found.

Client-side there is nothing better than that, but it does not mean that it
cannot be done using an ECMAScript implementation server-side.

HTH

PointedEars
___________
[OWASP]
The Open Web Application Security Project: Authentication Cheet Sheet.
(updated: 2012-09-28)
<https://www.owasp.org/index.php/Authentication_Cheat_Sheet>

[RFC2046]
Freed, N., Borenstein, N.: Multipurpose Internet Mail Extensions (MIME) Part
Two: Media Types. November 1996. <http://tools.ietf.org/html/rfc2046>

[SO]
StackOverflow: What is the maximum length of a URL? (updated: 2012-07-12)
<http://stackoverflow.com/a/417184/855543>
--
Use any version of Microsoft Frontpage to create your site.
(This won't prevent people from viewing your source, but no one
will want to steal it.)
  -- from <http://www.vortex-webdesign.com/help/hidesource.htm> (404-comp.)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Patricia Shanahan  
View profile  
 More options Oct 3 2012, 3:04 pm
Newsgroups: comp.lang.javascript
From: Patricia Shanahan <p...@acm.org>
Date: Wed, 03 Oct 2012 20:04:46 +0100
Local: Wed, Oct 3 2012 3:04 pm
Subject: Re: Sending email with attachments
Thomas 'PointedEars' Lahn wrote:
> Patricia Shanahan wrote:

...
> Technically, an e-mail attachment is a part of the message body of a multi-
> part message, following a delimiter line, own header and usually a Base64-
> encoded message-part body (see [RFC2046]); so, in theory, it could work.  
> But I would not recommend it for production.  In fact, security measures
> might prevent it.

...

It does sound worth investigating.

>> Another option is to just display the data and invite the user to
>> select and copy. The data could then be pasted into the body of an
>> e-mail, or into a text file in an editor window. I believe that would
>> work, but involves more end user busy work than is ideal.

> Yes, in a Web application you should make best use of the *Web* first.

I'm not writing a web application.

I'm writing an application that happens to be implemented in HTML and
JavaScript, and use a browser as the run time. If iPad had a suitable
Java runtime, and a less inconvenient development process, it would have
been a Java application. Because of the choice of languages, one way of
deploying it is to use HTTP to get the files from some server. For other
combinations of situation and device, it may be better to download the
application to the client file system.

Patricia


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dr J R Stockton  
View profile  
 More options Oct 3 2012, 2:49 pm
Newsgroups: comp.lang.javascript
From: Dr J R Stockton <reply1...@merlyn.demon.co.uk.invalid>
Date: Wed, 3 Oct 2012 19:49:32 +0100
Local: Wed, Oct 3 2012 2:49 pm
Subject: Re: Sending email with attachments
In comp.lang.javascript message <JqadnXQNAdXTHffNnZ2dnUVZ_qSdnZ2d@earthl
ink.com>, Mon, 1 Oct 2012 22:49:04, Patricia Shanahan <p...@acm.org>
posted:

>I am writing a data collection application. It needs to run on as many
>tablets and laptops as possible, so I'm writing it in HTML and
>JavaScript. Although I cannot ask end users to buy a particular device,
>I can ask them to install an up to date browser.
> ...

I see no reason why you should not offer more than one method.

You can display the data, and the address, etc., and invite the user to
copy'n'paste into their ordinary E-mail system.  Ensure that the data
fits in 72 characters per line, with newlines between, and uses only
7-bit characters, and has a data delimiter before and after, and it
should be possible to extract it reliably from a received E-mail.  That
should all be easy for you to arrange.

You can then develop some other method, perhaps using code on the server
to forward the message; and once it is working you can allow users to do
that instead.

Some users might refer E-mail, as giving them a record of what was sent
when in a "filing system" that they already have.

But, as "someone new to JavaScript", your first thought should be to
find a confederate who already knows the language.  Advertise in your
village magazine; look for scripted web pages that are local to your
town; employ a local firm who knows about such things, or whatever.

Remember that the fact that any idiot can start writing JavaScript
inevitably means that a large number of them have done so.

Read the newsgroup FAQ.

--
 (c) John Stockton, nr London UK               Reply address via Home Page.
   news:comp.lang.javascript FAQ <http://www.jibbering.com/faq/index.html>.
   <http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
   <http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eli the Bearded  
View profile  
 More options Oct 3 2012, 7:08 pm
Newsgroups: comp.lang.javascript
From: Eli the Bearded <*...@eli.users.panix.com>
Date: Wed, 3 Oct 2012 23:08:07 +0000 (UTC)
Local: Wed, Oct 3 2012 7:08 pm
Subject: Re: Sending email with attachments
In comp.lang.javascript,
Dr J R Stockton  <reply1...@merlyn.demon.co.uk.invalid> wrote:

> You can display the data, and the address, etc., and invite the user to
> copy'n'paste into their ordinary E-mail system.  Ensure that the data
> fits in 72 characters per line, with newlines between, and uses only
> 7-bit characters, and has a data delimiter before and after, and it
> should be possible to extract it reliably from a received E-mail.  That
> should all be easy for you to arrange.

If the poster does go down that route, be aware that whitespace
get mangled in email often, so not making whitespace significant
will help to reliably extract the message. (Or make all whitespace
interchangable: one newline is as good as two spaces, etc.)

Really the simple way to do this, is format the data however you
want, then apply the standard base64 encoding to it, and add headers.
The message will look a lot like a raw mail attachment, or a PGP
encypted block, or a SSL certificate, or ...

Elijah
------
the space issue sometimes came up with uuencode


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Patricia Shanahan  
View profile  
 More options Oct 3 2012, 9:43 pm
Newsgroups: comp.lang.javascript
From: Patricia Shanahan <p...@acm.org>
Date: Thu, 04 Oct 2012 02:43:15 +0100
Local: Wed, Oct 3 2012 9:43 pm
Subject: Re: Sending email with attachments
Dr J R Stockton wrote:
...

> But, as "someone new to JavaScript", your first thought should be to
> find a confederate who already knows the language.  Advertise in your
> village magazine; look for scripted web pages that are local to your
> town; employ a local firm who knows about such things, or whatever.

I think "new to JavaScript" may have been ambiguous. I am not new to
programming, or to learning programming languages, just to JavaScript. I
have over 30 years professional programming experience and a doctorate
in computer science. I have studied many programming languages, starting
with Fortran in 1967.

Usually, when I decide a program I want to write should be in a language
I don't already know my first thought is to get reading and writing. I
read books, tutorials, specifications, newsgroups, newsgroup FAQs, and
existing code. I write short practice programs, starting with the
basics, but after a couple of weeks of learning JavaScript I'm on to
experimenting with some of the difficulties I need to solve.

Is JavaScript especially difficult to learn?

It does combine a lot of features, but I have not yet encountered a
completely new feature, as distinct from variations on ideas I already
understand. Even the browser incompatibility issue reminds me of the
state of Fortran in the early 1980's.

Patricia


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Patricia Shanahan  
View profile  
 More options Oct 3 2012, 9:46 pm
Newsgroups: comp.lang.javascript
From: Patricia Shanahan <p...@acm.org>
Date: Thu, 04 Oct 2012 02:46:15 +0100
Local: Wed, Oct 3 2012 9:46 pm
Subject: Re: Sending email with attachments

The whitespace issue is a good point against sending the data unencoded.

The data is spreadsheet-like, and needs to end up in a spreadsheet, so
csv is the obvious text format, but newlines are significant. Breaking a
long line into two shorter lines would create two spreadsheet rows where
there should be one.

Patricia


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Scott Sauyet  
View profile  
 More options Oct 3 2012, 10:42 pm
Newsgroups: comp.lang.javascript
From: Scott Sauyet <scott.sau...@gmail.com>
Date: Wed, 3 Oct 2012 19:42:05 -0700 (PDT)
Local: Wed, Oct 3 2012 10:42 pm
Subject: Re: Sending email with attachments

Patricia Shanahan wrote:
> The data is spreadsheet-like, and needs to end up in a spreadsheet, so
> csv is the obvious text format, but newlines are significant. Breaking a
> long line into two shorter lines would create two spreadsheet rows where
> there should be one.

For this and other similar reasons, the body of an email is almost
certainly a terrible transport medium for the data you describe.  You
could use email attachments, but as already discussed, that probably
won't be possible with client-side Javascript.

  -- Scott


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Scott Sauyet  
View profile  
 More options Oct 3 2012, 10:54 pm
Newsgroups: comp.lang.javascript
From: Scott Sauyet <scott.sau...@gmail.com>
Date: Wed, 3 Oct 2012 19:54:58 -0700 (PDT)
Local: Wed, Oct 3 2012 10:54 pm
Subject: Re: Sending email with attachments

Patricia Shanahan wrote:
> I think "new to JavaScript" may have been ambiguous. I am not new to
> programming, or to learning programming languages, just to JavaScript. I
> have over 30 years professional programming experience and a doctorate
> in computer science. I have studied many programming languages, starting
> with Fortran in 1967.

> [ ... ]

> Is JavaScript especially difficult to learn?

No it is not.  There are difficulties in browser-scripting because of
the incompatibilities, but there is nothing particularly challenging
about the language.  But, if you're familiar with C-style languages,
it's easy to expect this one to act more like those than it does just
because of syntactic similarity.

Assuming you have experience with a language that has functional
aspect, whether pure functional like ML or Haskell, or ones that have
major functional techniques like LISP or Scheme, then you should be
able to quickly grasp a big part of how the language differs from ones
like Java or C#.  The only other really unusual major aspect of the
language is is prototypal inheritance.

  -- Scott


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Patricia Shanahan  
View profile  
 More options Oct 5 2012, 9:07 pm
Newsgroups: comp.lang.javascript
From: Patricia Shanahan <p...@acm.org>
Date: Sat, 06 Oct 2012 02:07:25 +0100
Local: Fri, Oct 5 2012 9:07 pm
Subject: Re: Sending email with attachments

Thomas 'PointedEars' Lahn wrote:
> Patricia Shanahan wrote:
..
>> I've done web searches, and the closest I've been able to get is to fold
>> the data into a mailto URL as the message body, not an attachment.

> Technically, an e-mail attachment is a part of the message body of a multi-
> part message, following a delimiter line, own header and usually a Base64-
> encoded message-part body (see [RFC2046]); so, in theory, it could work.  
> But I would not recommend it for production.  In fact, security measures
> might prevent it.

I've done some more web searches and experiments. Unfortunately, the
comment about security measures seems to be correct.

RFC 6068, "The 'mailto' URI Scheme" says "Only a limited set of header
fields such as Subject and Keywords, as well as Body, are believed to be
both safe and useful in the general case."

I've tested with Firefox as browser and Thunderbird as mail client. The
content type header in the message as delivered is "text/plain;
charset=ISO-8859-1; format=flowed" regardless of my attempts to specify
a multi-part content type in the URI.

Patricia


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Thomas 'PointedEars' Lahn  
View profile  
 More options Oct 6 2012, 2:48 am
Newsgroups: comp.lang.javascript
Followup-To: comp.lang.javascript
From: Thomas 'PointedEars' Lahn <PointedE...@web.de>
Date: Sat, 06 Oct 2012 08:48:23 +0200
Local: Sat, Oct 6 2012 2:48 am
Subject: Re: Sending email with attachments

Patricia Shanahan wrote:
> RFC 6068, "The 'mailto' URI Scheme" says "Only a limited set of header
> fields such as Subject and Keywords, as well as Body, are believed to be
> both safe and useful in the general case."

> I've tested with Firefox as browser and Thunderbird as mail client. The
> content type header in the message as delivered is "text/plain;
> charset=ISO-8859-1; format=flowed" regardless of my attempts to specify
> a multi-part content type in the URI.

I had not considered the requirement for the main `Content-Type' header
field of multi-part messages.

The question remains why it would be acceptable to send the data over the
Internet via e-mail to an SMTP server, but not over the Internet to an HTTP
server.

PointedEars
--
var bugRiddenCrashPronePieceOfJunk = (
    navigator.userAgent.indexOf('MSIE 5') != -1
    && navigator.userAgent.indexOf('Mac') != -1
)  // Plone, register_function.js:16


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Patricia Shanahan  
View profile  
 More options Oct 6 2012, 3:29 pm
Newsgroups: comp.lang.javascript
From: Patricia Shanahan <p...@acm.org>
Date: Sat, 06 Oct 2012 20:29:48 +0100
Local: Sat, Oct 6 2012 3:29 pm
Subject: Re: Sending email with attachments
Thomas 'PointedEars' Lahn wrote:

...

> The question remains why it would be acceptable to send the data over the
> Internet via e-mail to an SMTP server, but not over the Internet to an HTTP
> server.

The difference is that most tablets already have access to an existing
SMTP server, and any SMTP server, without special configuration, can
forward e-mail to some mailbox that can be accessed from the workstation
where that particular data set will be processed.

On the other hand, organizations using the software are unlikely to have
an HTTP server set up with the right scripts. Typically, the department
that might use the software I'm writing will not have the sort of
control over a server that it takes to install new scripts on it.

I could install scripts in my personal domain, but I don't think users
would want their data to go through my domain.

Patricia


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Thomas 'PointedEars' Lahn  
View profile  
 More options Oct 6 2012, 3:50 pm
Newsgroups: comp.lang.javascript
Followup-To: comp.lang.javascript
From: Thomas 'PointedEars' Lahn <PointedE...@web.de>
Date: Sat, 06 Oct 2012 21:49:37 +0200
Local: Sat, Oct 6 2012 3:49 pm
Subject: Re: Sending email with attachments

ACK.  Alternative approaches can be suggested if you describe your problem
in more detail:

<http://www.catb.org/~esr/faqs/smart-questions.html#beprecise>

PointedEars
--
Sometimes, what you learn is wrong. If those wrong ideas are close to the
root of the knowledge tree you build on a particular subject, pruning the
bad branches can sometimes cause the whole tree to collapse.
  -- Mike Duffy in cljs, <news:Xns9FB6521286DB8invalidcom@94.75.214.39>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Patricia Shanahan  
View profile  
 More options Oct 7 2012, 3:13 am
Newsgroups: comp.lang.javascript
From: Patricia Shanahan <p...@acm.org>
Date: Sun, 07 Oct 2012 08:13:43 +0100
Local: Sun, Oct 7 2012 3:13 am
Subject: Re: Sending email with attachments

I cannot describe my current project in public until it is further
along. I'm not asking for general help with my program design. That's my
problem.

I just wanted to check whether a specific user requirement could be met
using only HTML and JavaScript, after I had failed to find a solution by
reading books, web searching, thinking, and experiments. As I indicated
in my first article, I was fully aware of server based solutions, but
they are not appropriate for my application.

I've got the answer to my question - I can only send text in an e-mail -
so I'm on to working with that answer.

I don't think it is a big enough problem to make me change strategy from
HTML + JavaScript to installable application implementations for each
major group of environments.

Thanks for your help,

Patricia


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Stefan Weiss  
View profile  
 More options Oct 7 2012, 6:46 am
Newsgroups: comp.lang.javascript
From: Stefan Weiss <krewech...@gmail.com>
Date: Sun, 07 Oct 2012 12:46:58 +0200
Local: Sun, Oct 7 2012 6:46 am
Subject: Re: Sending email with attachments
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.

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).

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.

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.

- stefan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Messages 1 - 25 of 44   Newer >
« Back to Discussions « Newer topic     Older topic »