Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

SMTP authentication support #5

Merged
merged 1 commit into from

3 participants

@remac

It will default to no-auth. 
To add SMTP authentication you need to modify smtp_client in system_config to:
"relay": "your_smtp_server",
       "username": "username",
       "password": "password",
       "port": "25",
       "auth": "always"

@arekfryz arekfryz SMTP authentication support
It will default to no-auth. 
To add SMTP authentication you need to modify smtp_client in system_config to:
"relay": "your_smtp_server",
       "username": "username",
       "password": "password",
       "port": "25",
       "auth": "always"
edd6f7f
@dschreiber dschreiber merged commit 0826d44 into 2600hz:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 21, 2013
  1. @arekfryz

    SMTP authentication support

    arekfryz authored
    It will default to no-auth. 
    To add SMTP authentication you need to modify smtp_client in system_config to:
    "relay": "your_smtp_server",
           "username": "username",
           "password": "password",
           "port": "25",
           "auth": "always"
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 1 deletion.
  1. +6 −1 whistle_apps/apps/notify/src/notify_util.erl
View
7 whistle_apps/apps/notify/src/notify_util.erl
@@ -38,12 +38,17 @@ send_email(_, <<>>, _) -> ok;
send_email(From, To, Email) ->
Encoded = mimemail:encode(Email),
Relay = wh_util:to_list(whapps_config:get(<<"smtp_client">>, <<"relay">>, <<"localhost">>)),
+Username = wh_util:to_list(whapps_config:get(<<"smtp_client">>, <<"username">>, <<"">>)),
+Password = wh_util:to_list(whapps_config:get(<<"smtp_client">>, <<"password">>, <<"">>)),
+Auth = wh_util:to_list(whapps_config:get(<<"smtp_client">>, <<"auth">>, <<"never">>)),
+Port = wh_util:to_list(whapps_config:get(<<"smtp_client">>, <<"port">>, <<"25">>)),
+
lager:debug("sending email to ~s from ~s via ~s", [To, From, Relay]),
ReqId = get(callid),
Self = self(),
- gen_smtp_client:send({From, [To], Encoded}, [{relay, Relay}]
+ gen_smtp_client:send({From, [To], Encoded}, [{relay, Relay},{username, Username}, {password, Password}, {port, Port}, {auth, Auth}]
,fun(X) ->
put(callid, ReqId),
lager:debug("email relay responded: ~p, send to ~p", [X, Self]),
Something went wrong with that request. Please try again.