E-mailing a text file

Sarah Reichelt sarah.reichelt at gmail.com
Fri Jun 13 17:27:31 EDT 2008


On Fri, Jun 13, 2008 at 11:09 PM, Charles Szasz <cszasz at mac.com> wrote:
>
> I have developed a simple app for making a monthly report for my staff of
> school psychologists. After the user uses the app, a text file is generated.
> This was my goal when I started on this project a few days ago. Now, I
> wondering how much more coding would be needed if the user could instead
> e-mail the report vs. sending the report by regular mail. Despite using Rev
> for three years, I have never use code for using the internet! Is this a
> simple task for Rev? I know that the text file would have be compressed to
> avoid corruption of the file. Any suggestions?

As Andres has said, the easiest way is to use revMail. That will
create a new email in the user's regular email program so your app
will not need to do any internet stuff itself or need to know any mail
settings. Any connection problems will be obvious to the user and the
emails will automatically be saved for sending later, so emails are
unlikely to be lost.

If you want the emailing to be invisible to the user, then you can do
the work yourself by opening a socket to an SMTP server and sending
the data via script. I have an SMTP library which you are welcome to
use <http://www.troz.net/Rev/libraries.php> and Shao Sean has also
written one with Chipp Walter's writing altEmailHarness to act as an
intermediary. In this case, the user will need to enter mail settings:
SMTP server, authentication details if required, sender's email
address, recipients.

A third alternative is to use a CGI script on a server somewhere that
accepts a POST containing all the data and uses it's own sendmail to
create and send the email from the server. This has the advantage that
the user is not required to know and server settings as the web server
does all that.

GIven what you have described above, I would go with option 1.

Regards,
Sarah



More information about the use-livecode mailing list