-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathREADME
31 lines (22 loc) · 1.44 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Erlgmail is a knocked together OTP app that simplyfies sending email through googlemail. It is just a wrapper on the work by Benjamin Nortier in this (http://21ccw.blogspot.com/2009/05/how-to-send-email-via-gmail-using.html) blog post.
And it now supports sending HTML email thanks to davide.
To use:
The cfg file now allows "profiles". Also the app now follows OTP env config standards better. If you wish to start an erlgmail OTP application instance with a different config file simply start like:
erl -erlgmail config_file '"/absolute/location/of/config/file.cfg"'
Or edit the example erlgmail.cfg in the priv directory.
There MUST be a profile named "default" or things won't work. The send API now accepts an optional "profile" parameter.
If no "profile" (an atom) is specified then "default" is assumed.
git clone
cd erlgmail
make
cd priv
vi erlgmail.cfg
add your own google account information (and add default too list (useful for form mailer type stuff))
cd ebin (or put it in $ERL_LIBS)
erl -boot start_sasl -config $ERL_LIBS/erlgmail/sasl.config (or your own config)
or erl -boot start_sasl -config /path/to/SASL_CONF -erlgmail '"/abs/path/to/conf.cfg"'
1> ssl:start().
2> application:start(erlgmail).
3> erlgmail:send("Subject", "Message Body", ["[email protected]"], ["Mister To Who"]).
4> erlgmail:psend("Subject", "Message", myprofile_x).
5> erlgmail:send_html("Subject", "<h1>Big Hello!</h1><img src='trackyou.image'/><br/><strong>An HTML email</strong>").