Through an odd series of events beginning with the announcement of a new release of the F# programming language, I ended up installing the Mono system on my Mac.
I had been in the business of selling a command-line mailer that I later ported to C#. I quit selling the program (MailWrench) and made its source available under the MIT/X11 license. I have just recompiled MailWrench under OS/X using Mono.
It works! I had written a smaller command-line emailer in Go (Golang) so that I could run the same program on OS/X and Windows. It appears that I can fall back to using MailWrench.
Please note that I haven’t updated the Github repo for MailWrench, yet.
If you use the current 2.0 Github source, you’ll have to take out imports that reference System.Drawing and System.Windows.Forms … they’re not used, but I hadn’t realized they were in the code until I tried to compile under Mono. I’ll be changing the source code soon enough so that Windows, Mac, and Linux editions will all sport their own OS-specific identifier in the program’s output.
To build MailWrench on the Mac, issue this command.
I was going to send mail via GMail, so I had to update the certs in the Mono system. I issued these commands:
mozroots –import –ask-remove
certmgr -ssl smtps://smtp.gmail.com:465
…answering positively to the prompts.
I would like to statically link the LGPL’ed runtimes so that I can create a pure OS/X binary. I had hoped that this commmand:
mkbundle –static mailwrench.exe -o mailwrench
…would yield an OS/X binary. However, there appear to be some libraries that I have to install, first. That’s a task for another day.
I issued a test MailWrench command:
mono mailwrench.exe -to email@example.com -from firstname.lastname@example.org -s “test subject” -msg “This is a test” -id email@example.com -password mypassword -ssl -smtp smtp.gmail.com -port 587
( The above was entered into a shell script …)
The output that I got to see was something I didn’t think I’d ever see outside of Windows:
I received the email: