Sending emails, with attachments, on your server

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Sending emails, with attachments, on your server

Wprothero
Folks:
I’ve put together a little tutorial stack for those who want to send email from their server, rather than from the user’s local email system. This can be very useful when users sit at different and possibly public computers, where there may be no email system installed, or where the configuration may not be suitable for your app.

The tutorial provides the livecode script and a php script for you to put on your server. It allows you to send an attachment, and could be modified for more.

Special note: you need to download php opensource software called “phpMailer” at:
https://github.com/PHPMailer/PHPMailer <https://github.com/PHPMailer/PHPMailer>

You only need to use the PHPMailerAutoload.php and the class.phpmailer.php files from phpMailer. But it provides other examples that you can use, if you need more than I provide.

The documentation of the example for       libURLMultipartFormAddPart(tForm,"userfile", tFile, tType, tEnc) has an error, also.  The example should say:

      if libURLMultipartFormAddPart(tForm,"userfile", tFile, tType, tEnc) is not empty then
         ##handle error and exit
         exit mouseUp
      end if  

The “is not” part of the If line is the error in the documentation. For somebody struggling with headers, this is a major pain in the butt and it creates confusion when trying to figure it out.

Here is the link, in case you have a need for this:
Download the file from this page.
http://es.earthednet.org/SoftwareForEducation <http://es.earthednet.org/SoftwareForEducation>

I hope this helps somebody who wants their server to send email from their app.

Regards,
Bill

William Prothero, Ph.D.
University of California, Santa Barbara, Emeritus
[hidden email]



_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Http://es.earthednet.org
Reply | Threaded
Open this post in threaded view
|

Re: Sending emails, with attachments, on your server

tbodine
Thanks Bill!
Tom
Reply | Threaded
Open this post in threaded view
|

Re: Sending emails, with attachments, on your server

Wprothero
Tom,
You're welcome. Seems php isn't very popular here, but I find it very convenient and fast, and already integrated into most server situations. Of course, since I've programmed in numerous other languages, it isn't a big deal, and avoids some of the issues with Livecode that are a result of the massive changes being implemented. I don't mean to be critical of lc, but php has had many years of refinement, has massive documentation and help, and for very small jobs like online db communication and file management, it is an effective solution.

Best,
Bill

William Prothero
http://ed.earthednet.org

> On Jan 27, 2016, at 8:30 AM, tbodine <[hidden email]> wrote:
>
> Thanks Bill!
> Tom
>
>
>
> --
> View this message in context: http://runtime-revolution.278305.n4.nabble.com/Sending-emails-with-attachments-on-your-server-tp4700411p4700465.html
> Sent from the Revolution - User mailing list archive at Nabble.com.
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Http://es.earthednet.org
Reply | Threaded
Open this post in threaded view
|

Re: Sending emails, with attachments, on your server

Dave Kilroy
In reply to this post by Wprothero
Thank you Bill - I've downloaded it and squirrelled it away for playing with later - it looks really useful and much better than the kind of thing I usually cobble together :)
"The first 90% of the task takes 90% of the time, and the last 10% takes the other 90% of the time."
Peter M. Brigham