Still cannot get the SMTP settings to work. but I now get the following error:
2020-06-02 19:04:21,500 [ERROR anvil.app-server.run] Error report from client code:
AnvilWrappedError: Invalid Addresses
Traceback:
<rpc>:0
anvil-services/anvil/users.py:63
anvil-services/anvil/users.py:469
anvil-services/anvil/users.py:469
app/CC_Test/Form1/__init__.py:15
But I believe I have might have found some answers by looking into code I don’t entirely understand. And on that basis please excuse me if I’m talking complete rubbish!
-
smtp-encryption: option will accept the following values “ssl” or “starttls”.
From email.clj line 227:
(defn smtp-send [{:keys [host port user pass encryption] :as _smtp-config}
{:keys [from-address from-name to cc bcc subject text html attachments inline-
attachments in-reply-to references app-id] :as _message}](when-not host
(throw+ {:anvil/server-error “No SMTP server has been configured for this app”}))(let [session (Session/getInstance (make-props (merge {“mail.smtp.starttls.enable” (if (contains? #
{“ssl” “starttls”} encryption) “true” “false”)}
(when (= encryption “starttls”)
{“mail.smtp.starttls.required” “true”})))) -
It appears that the smtp email “from account” might be hard coded to “accounts” which would make the “Invalid Addresses” error make sense as it is not a valid user on my email host.
From core.clj Line 232:
(defn send-email! [to subject text]
(if (get-in @util/*session-state* [:users :test-email-divert])
(swap! util/*session-state* update-in [:users :test-email-divert] concat [{:to to, :subject subject, :text text}])
(binding [email/*use-quota* false
email/*require-service-config* false]
(email/send! {:from_name (if (app-data/abuse-caution? util/*session-state* util/*app-id*)
"Accounts"
(str (:name util/*app*) " Accounts"))
:from_address "accounts"
:to to
:subject subject
:text text}))))
Can someone check if I am understanding the code correctly and if my conclusion is correct.