Sending emails, with attachments, on your server

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

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: <>

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

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


William Prothero, Ph.D.
University of California, Santa Barbara, Emeritus
prothero at

More information about the use-livecode mailing list