<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[I want to have a script send an email via Cloudron]]></title><description><![CDATA[<p dir="auto">Heyo,</p>
<p dir="auto">I have a script I'm going to run on my Cloudron server, it updates a .ics file hosted with Surfer. I'd like to receive an email at my regular (non-Cloudron) account when the login credentials stop working or for some other reason the script updating the .ics file fails.</p>
<p dir="auto">Is there a way I can send emails from the script while leaving Cloudron email in its stock state? The automated emails it sends right now work just fine. I'd prefer not to have to enable receiving, set up user accounts, etc. This thread is tangentially related but didn't hit the nail on the head: <a href="https://forum.cloudron.io/topic/3965/use-cloudron-email-for-sending-email-smtp-on-application-hosted-outside-cloudron">https://forum.cloudron.io/topic/3965/use-cloudron-email-for-sending-email-smtp-on-application-hosted-outside-cloudron</a></p>
<p dir="auto">Thanks for your help</p>
]]></description><link>https://forum.cloudron.io/topic/10236/i-want-to-have-a-script-send-an-email-via-cloudron</link><generator>RSS for Node</generator><lastBuildDate>Sun, 17 May 2026 03:16:54 GMT</lastBuildDate><atom:link href="https://forum.cloudron.io/topic/10236.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 21 Oct 2023 09:33:08 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to I want to have a script send an email via Cloudron on Mon, 23 Oct 2023 18:11:35 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/81ewlska" aria-label="Profile: 81ewlska">@<bdi>81ewlska</bdi></a> you can send a mail like this:</p>
<ul>
<li>Get mail server container IP - <code>docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' mail</code></li>
<li>Get relay auth token - <code>docker inspect -f '{{range $index, $value := .Config.Env}}{{if eq (index (split $value "=") 0) "CLOUDRON_RELAY_TOKEN" }}{{range $i, $part := (split $value "=")}}{{if gt $i 1}}{{print "="}}{{end}}{{if gt $i 0}}{{print $part}}{{end}}{{end}}{{end}}{{end}}' mail</code> . Don't ask me how this works, I stole it from Stack overflow <img src="https://forum.cloudron.io/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=11345d81604" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" style="height:23px;width:auto;vertical-align:middle" title=":-)" alt="🙂" /> But essentially, CLOUDRON_RELAY_TOKEN is an environment variable in the container. You can also get this from <code>docker inspect mail | grep CLOUDRON_RELAY_TOKEN</code> and do some string manipulation.</li>
</ul>
<p dir="auto">Then, send mail (<code>example.com</code> below is your primary domain):</p>
<pre><code>swaks --server &lt;mail_server_ip&gt; --port 2525 --from no-reply@example.com --to test@cloudron.io \
    --body "Test mail from Cloudron" \
    --auth-user no-reply@example.com --auth-password &lt;relay_token&gt;
</code></pre>
<p dir="auto">Note: above only works from the server itself. You cannot send mails from outside the server using a token.</p>
]]></description><link>https://forum.cloudron.io/post/75822</link><guid isPermaLink="true">https://forum.cloudron.io/post/75822</guid><dc:creator><![CDATA[girish]]></dc:creator><pubDate>Mon, 23 Oct 2023 18:11:35 GMT</pubDate></item><item><title><![CDATA[Reply to I want to have a script send an email via Cloudron on Sat, 21 Oct 2023 17:11:59 GMT]]></title><description><![CDATA[<p dir="auto">The script currently lives in the home directory of the VPS instance that hosts Cloudron, and it updates a file exposed to the world by Surfer. Ideally there is a line or two I can add to the script (python) that sends an email if the script fails. Obviously Cloudron has some built-in capabilities for this, since it sends emails; can I access these capabilities easily? I'd like to avoid having to install an email client, set up users, etc.</p>
]]></description><link>https://forum.cloudron.io/post/75706</link><guid isPermaLink="true">https://forum.cloudron.io/post/75706</guid><dc:creator><![CDATA[81ewlska]]></dc:creator><pubDate>Sat, 21 Oct 2023 17:11:59 GMT</pubDate></item><item><title><![CDATA[Reply to I want to have a script send an email via Cloudron on Sat, 21 Oct 2023 13:57:51 GMT]]></title><description><![CDATA[<p dir="auto">not sure I understand what you ask for. How is email sending, surfer and the .ics file connected? If you just want to send an email via a mail account on your Cloudron, I guess you can use any email client which supports scripting to do so?</p>
<p dir="auto">Where would this script, you refer to, run?</p>
]]></description><link>https://forum.cloudron.io/post/75700</link><guid isPermaLink="true">https://forum.cloudron.io/post/75700</guid><dc:creator><![CDATA[nebulon]]></dc:creator><pubDate>Sat, 21 Oct 2023 13:57:51 GMT</pubDate></item></channel></rss>