Stand Blue Technology -> projects.standblue.net -> Moto Documentation -> Sending Mail

Sending Mail in Moto

This requires that there be an SMTP server listening on 127.0.0.1. If you want to use a different mail server just hack smtp.c from below.

First download the moto-mail tarball: The following three files are included in the above tarball:

Note: This is not original code, it comes from Tridge, of samba fame: http://pserver.samba.org/cgi-bin/cvsweb/weblist/smtp.c?annotate=1.1&sortby=rev. Dave just sent this to me cause I was bugging him about it.

Make directories and copy files

Now cd to your moto root (probably /usr/local/moto) and into the mx directory. Then make a directory that you want to use for this library. For example, if you make a directory mail/smtp then you would call it from moto using \$use("mail.smtp")

 shell# cd /usr/local/moto/mx
 shell# mkdir -p mail/smtp

Now, cd into that directory, and copy all the above files into it. You are going to need to copy one more file from your moto src directory. This can be any Makefile from in any of the \$SRC/mx/* directories.

 shell# cp /usr/local/src/moto_0_13_0/mx/codex/util/Makefile /usr/local/moto/mx/mail/smtp/

Building the library

Now you can cd into the library and type make

 shell# cd /usr/local/moto/mx/mail/smtp/
 shell# make

You should now be good to go, you can \$use("mail.smtp") in your moto code and send mail. Its not too tricky to see what the functions do by looking at MailServer.i, but I have also put up a sample file mail.txt.

cwright@standblue.net