Sending emails, with attachments, on your server

William Prothero prothero at earthednet.org
Mon Jan 25 18:53:57 EST 2016


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
prothero at earthednet.org






More information about the Use-livecode mailing list