The GCALDaemon's Gmail sender is a mail transfer agent that polls a local folder for new messages.
When a new message is found, the service sends your plain text or HTML files
without your having to open your e-mail client.
With this solution you can send Gmail messages directly and easily from your text editor or from your application.
1) Install GCALDaemon (Java 1.5 required).
2) Start password encoder ('password-encoder.bat' or 'password-encoder.sh').
Input your Gmail password and press ENTER. Copy the encoded password.
3) Edit the 'gcal-daemon.cfg' file with your text editor.
A) Set the 'sendmail.enabled' property to 'true'
B) Set the 'sendmail.google.username' property to your Gmail address
C) Set the 'sendmail.google.password' property to your encoded password
Optionally, set the 'sendmail.dir.path' property to refer to the outgoing mail folder.
4) Setup finished - start GCALDaemon with 'standalone-start.bat' or 'standalone-start.sh'.
5) Open your text editor, and create a short test message.
Save this test message into your outgoing mail directory (/outbox) named recipient@company.com
(you must enter a valid email address).
6) GCALDaemon submits your mail within 10-15 seconds.
7) You can send HTML files in a similar manner, or a simple copy/paste/rename command.
You can add special email properties to your message. The valid properties are:
TO - Comma-separated list of primary recipients (optional, default: sender or filename)
CC - Comma-separated list of subsidiary recipients (carbon copy, optional)
BCC - Comma-separated list of BCC recipients (blind carbon copy, optional)
SUBJECT - Title of the email (optional, default: "Mail from <sender>")
ENCODING - Character encoding of the mail (optional, default: platform-specific)
All property are optional and case insensitive, the name of the text file doesn't matter
(recipients determined by the file's content). Use "UTF-8" encoding for special characters,
otherwise use "ISO-8859-1", "ISO-8859-2", "US-ASCII" or other standard encoding. You can use HTML formatter
tags like <b>, <i>, <font...>, <color...>, <center>, <br/>, etc.
GCALDaemon autodetects HTML tags in the
message's body, and changes the mail's content type to "text/html". Note: do not include
entire HTML pages, with <html>, <head> and <body> parts -
only the formatter tags are allowed.
If the file starts with an XML header ('<?xml...'), then it processed as an XML file.
GCALDaemon detects file encoding by the XML header's encoding property.
All descriptions of the properties are same as attributes/properties associated with structured text messages.
GCALDaemon detects HTML tags in the <body> element, and changes the mail's content type to "text/html".
GCALDaemon ignores all unknown/undefined XML attributes, elements, CDATA sections, namespaces, etc.
Writing files is actually fairly easy in all programming languages and scripts.
More easier than implement the a new mail sender (connection pool,
SSL communicator, character and password encoder, firewall handler, etc) from scratch.
You can save your time by using GCALDaemon's mail transfer agent to create
your own home application.
Sample Java code:
// Mail parameters
String to = "recipient@sample.mail.com";
String subject = "Mail's subject";
String body = "This is the body of my mail message.";
// Create file's content
String mail = "ENCODING:UTF-8\r\nTO:" + to + "\r\nSUBJECT:" + subject
+ "\r\n" + body;
byte[] bytes = mail.getBytes("UTF8");
String path = "/outbox/" + System.currentTimeMillis()
+ mail.hashCode() + ".txt";
// Save file
RandomAccessFile file = null;
try {
file = new RandomAccessFile(path, "rw");
file.write(bytes);
} finally {
if (file != null) {
file.close();
}
}
1) Start the 'service-install.bat' to install GCALDaemon as Windows service
(on UNIX-compatible systems put GCALDaemon into 'init', 'launchd' or 'rc' script).
Before uninstall GCALDaemon, you must stop and uninstall this service
(with 'service-stop.bat' and 'service-uninstall.bat').
Please note, this is the last step in the setup/configuration process,
do not install the service while GCALDaemon is not running properly.