<?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[Enviroment variables and how to use mail]]></title><description><![CDATA[<p dir="auto">First off: Is <a href="https://docs.cloudron.io/apps/lamp/#email" target="_blank" rel="noopener noreferrer nofollow ugc">the documentation for Email in LAMP</a> still valid? It says exposed variables look like <em>MAIL_SMTP_SERVER</em> but it seems all Cloudron enviroment variables within the LAMP app start with <em>CLOUDRON_</em></p>
<pre><code>root@a47d817b-fd94-42e1-9a01-4986c9952996:/app/data/public/config# printenv | grep MAIL_SMTP_SERVER
CLOUDRON_MAIL_SMTP_SERVER=mail
</code></pre>
<p dir="auto">So I assume the correct way to use these variables is:</p>
<pre><code>getenv('CLOUDRON_MAIL_SMTP_SERVER')
</code></pre>
<p dir="auto">Second:</p>
<p dir="auto">I want to use the <a href="https://github.com/friendica/friendica-addons/tree/develop/phpmailer" target="_blank" rel="noopener noreferrer nofollow ugc">phpmailer addon for a Friendica instance</a>. This addon replaces the <em>mail()</em> function with the PHPMailer library. The addon is configured and activated within the application but it still seems to look out for sendmail.</p>
<pre><code>www-data@900e2935-6f37-42bc-8609-86876b5a2105:~/public/addon/phpmailer$ composer show -i
phpmailer/phpmailer v6.2.0 PHPMailer is a full-featured email creation and transfer class for PHP
</code></pre>
<p dir="auto">LAMP log</p>
<pre><code>sh: 1: /usr/sbin/sendmail: not found
sh: 1: /usr/sbin/sendmail: not found
</code></pre>
<p dir="auto">Application log:</p>
<pre><code>index [ERROR]: PHPMailer error {"email":{"fromName":"\"der Administrator von Friendica Social Network\"","fromAddress":"REMOVED","replyTo":"REMOVED","toAddress":"REMOVED","subject":"ttes","msgHtml":"teswdfrsdf","msgText":"teswdfrsdf","additionalMailHeader":[],"toUid":null},"ErrorInfo":"Could not instantiate mail function.","exception":{}} - {"file":"phpmailer.php","line":108,"function":"phpmailer_emailer_send_prepare","uid":"f4936f","process_id":26}
</code></pre>
<p dir="auto">I also tried to use real (plain text) SMTP credentials with the same result <img src="https://forum.cloudron.io/assets/plugins/nodebb-plugin-emoji/emoji/android/1f61e.png?v=223f9defb2f" class="not-responsive emoji emoji-android emoji--disappointed" style="height:23px;width:auto;vertical-align:middle" title=":(" alt="😞" /> The relevant part of my <em>addon.config.php</em> looks like this:</p>
<pre><code>'phpmailer' =&gt; [
    // smtp (Boolean)
    // Enables SMTP relaying for outbound emails
    'smtp' =&gt; true,

    // smtp_server (String)
    // SMTP server host name
    'smtp_server' =&gt; getenv('CLOUDRON_MAIL_SMTP_SERVER'),

    // smtp_port (Integer)
    // SMTP server port number
    'smtp_port' =&gt; getenv('CLOUDRON_MAIL_SMTP_PORT'),

    // smtp_secure (String)
    // What kind of encryption to use on the SMTP connection.
    // Options: '', 'ssl' or 'tls'.
    'smtp_secure' =&gt; '',

    // smtp_port_s (Integer)
    // Secure SMTP server port number
    'smtp_port_s' =&gt; getenv('CLOUDRON_MAIL_SMTPS_PORT'),

    // smtp_username (String)
    // SMTP server authentication user name
    // Empty string disables authentication
    'smtp_username' =&gt; getenv('CLOUDRON_MAIL_SMTP_USERNAME'),

    // smtp_password (String)
    // SMTP server authentication password
    // Empty string disables authentication
    'smtp_password' =&gt; getenv('CLOUDRON_MAIL_SMTP_PASSWORD'),

    // smtp_from (String)
    // From address used when using the SMTP server
    // Example: no-reply@example.com
    'smtp_from' =&gt; getenv('CLOUDRON_MAIL_FROM'),
],
</code></pre>
]]></description><link>https://forum.cloudron.io/topic/4290/enviroment-variables-and-how-to-use-mail</link><generator>RSS for Node</generator><lastBuildDate>Tue, 14 Apr 2026 18:30:13 GMT</lastBuildDate><atom:link href="https://forum.cloudron.io/topic/4290.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 27 Jan 2021 21:54:23 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Enviroment variables and how to use mail on Tue, 09 Mar 2021 23:26:53 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peterle" aria-label="Profile: peterle">@<bdi>peterle</bdi></a> Yes, sure. We need to bring up the package at <a href="https://github.com/M-arcus/friendica-docker-image" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/M-arcus/friendica-docker-image</a> up to speed. It was packaged 3 years ago, so it probably won't work now.</p>
]]></description><link>https://forum.cloudron.io/post/27465</link><guid isPermaLink="true">https://forum.cloudron.io/post/27465</guid><dc:creator><![CDATA[girish]]></dc:creator><pubDate>Tue, 09 Mar 2021 23:26:53 GMT</pubDate></item><item><title><![CDATA[Reply to Enviroment variables and how to use mail on Tue, 09 Mar 2021 15:29:38 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/girish" aria-label="Profile: girish">@<bdi>girish</bdi></a><br />
you see any chance that friendica becomes a cloudron App?</p>
]]></description><link>https://forum.cloudron.io/post/27445</link><guid isPermaLink="true">https://forum.cloudron.io/post/27445</guid><dc:creator><![CDATA[peterle]]></dc:creator><pubDate>Tue, 09 Mar 2021 15:29:38 GMT</pubDate></item><item><title><![CDATA[Reply to Enviroment variables and how to use mail on Wed, 27 Jan 2021 23:25:36 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/subven" aria-label="Profile: subven">@<bdi>subven</bdi></a> As per <a href="https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting#could-not-instantiate-mail-function" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting#could-not-instantiate-mail-function</a>, if we use isSMTP which the addon uses, it should use SMTP directly. I will maybe give it a shot later today to understand why it's not sending mail.</p>
]]></description><link>https://forum.cloudron.io/post/24202</link><guid isPermaLink="true">https://forum.cloudron.io/post/24202</guid><dc:creator><![CDATA[girish]]></dc:creator><pubDate>Wed, 27 Jan 2021 23:25:36 GMT</pubDate></item><item><title><![CDATA[Reply to Enviroment variables and how to use mail on Wed, 27 Jan 2021 23:32:53 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/girish" aria-label="Profile: girish">@<bdi>girish</bdi></a> not in the UI or config. The addon needs to be installed and activated thats it. I think I saw them using hooks to distinguish between the sendmail and phpmailer.</p>
<p dir="auto">EDIT:</p>
<p dir="auto">What I noticed:  There is an issue with the from address. All my testmails seem to come from <a href="mailto:noreply@friendica.herewasmydomain.com" target="_blank" rel="noopener noreferrer nofollow ugc">noreply@friendica.herewasmydomain.com</a> instead of <a href="mailto:noreply@herewasmydomain.com" target="_blank" rel="noopener noreferrer nofollow ugc">noreply@herewasmydomain.com</a>. They fixed this with adding $SMTP_DOMAIN in their Docker repo. Fixing the wrong mail address for the (internal and hidden) system account in the database changed nothing.</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/girish" aria-label="Profile: girish">@<bdi>girish</bdi></a> thank you for digging into that but please do not waste too much time because this might be a rare use case and not really Cloudrons fault.</p>
]]></description><link>https://forum.cloudron.io/post/24201</link><guid isPermaLink="true">https://forum.cloudron.io/post/24201</guid><dc:creator><![CDATA[subven]]></dc:creator><pubDate>Wed, 27 Jan 2021 23:32:53 GMT</pubDate></item><item><title><![CDATA[Reply to Enviroment variables and how to use mail on Wed, 27 Jan 2021 23:08:46 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/subven" aria-label="Profile: subven">@<bdi>subven</bdi></a> Actually, it's easy to just put an error_log in <a href="https://github.com/friendica/friendica-addons/blob/develop/phpmailer/phpmailer.php#L35" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/friendica/friendica-addons/blob/develop/phpmailer/phpmailer.php#L35</a> and see if the function is getting called at all?</p>
<p dir="auto">edit: don't mind me, clearly the error message you initially posted is from <a href="https://github.com/friendica/friendica-addons/blob/develop/phpmailer/phpmailer.php#L108" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/friendica/friendica-addons/blob/develop/phpmailer/phpmailer.php#L108</a> .</p>
]]></description><link>https://forum.cloudron.io/post/24199</link><guid isPermaLink="true">https://forum.cloudron.io/post/24199</guid><dc:creator><![CDATA[girish]]></dc:creator><pubDate>Wed, 27 Jan 2021 23:08:46 GMT</pubDate></item><item><title><![CDATA[Reply to Enviroment variables and how to use mail on Wed, 27 Jan 2021 22:58:29 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/subven" aria-label="Profile: subven">@<bdi>subven</bdi></a> Is there possibly a setting in friendica to make it use phpmailer instead of sendmail (since phpmailer seems to be an addon)?</p>
]]></description><link>https://forum.cloudron.io/post/24198</link><guid isPermaLink="true">https://forum.cloudron.io/post/24198</guid><dc:creator><![CDATA[girish]]></dc:creator><pubDate>Wed, 27 Jan 2021 22:58:29 GMT</pubDate></item><item><title><![CDATA[Reply to Enviroment variables and how to use mail on Wed, 27 Jan 2021 22:46:58 GMT]]></title><description><![CDATA[<p dir="auto">True that <img src="https://forum.cloudron.io/assets/plugins/nodebb-plugin-emoji/emoji/android/1f61e.png?v=223f9defb2f" class="not-responsive emoji emoji-android emoji--disappointed" style="height:23px;width:auto;vertical-align:middle" title=":(" alt="😞" /> It seems like I have to give up here and host it elsewhere which is sad because they also have a Docker container.</p>
]]></description><link>https://forum.cloudron.io/post/24196</link><guid isPermaLink="true">https://forum.cloudron.io/post/24196</guid><dc:creator><![CDATA[subven]]></dc:creator><pubDate>Wed, 27 Jan 2021 22:46:58 GMT</pubDate></item><item><title><![CDATA[Reply to Enviroment variables and how to use mail on Wed, 27 Jan 2021 22:08:41 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/subven" aria-label="Profile: subven">@<bdi>subven</bdi></a> said in <a href="/post/24193">Enviroment variables and how to use mail</a>:</p>
<blockquote>
<pre><code>'smtp_port_s' =&gt; getenv('CLOUDRON_MAIL_SMTPS_PORT'),
</code></pre>
</blockquote>
<p dir="auto">This should be removed. Otherwise, your settings look correct. I will fix the docs to have the correct env vars. It seems that it is still looking for sendmail somewhere instead of using SMTP.</p>
]]></description><link>https://forum.cloudron.io/post/24194</link><guid isPermaLink="true">https://forum.cloudron.io/post/24194</guid><dc:creator><![CDATA[girish]]></dc:creator><pubDate>Wed, 27 Jan 2021 22:08:41 GMT</pubDate></item></channel></rss>