Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
CaranougaC

Caranouga

@Caranouga
About
Posts
2
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Lamp mail don't work
    CaranougaC Caranouga

    @nebulon Hello, thank you for your answer.

    I already changed the LAMP email, and there is indeed a caranouga@caradev.ml mailbox.

    I think I have an idea:

    I just went back to the creditentials.txt file, and I saw that there is a getenv('CLOUDRON_MAIL_DOMAIN') variable that gives caradev.ml, maybe the mail function is using this domain to send emails instead of using miningheberg.ml.

    Thanks to you,
    Caranouga

    PS: I don't have an administrator account so I can't see the lamp and cloudron settings, so I have to wait for my friend to show me.

    LAMP

  • Lamp mail don't work
    CaranougaC Caranouga

    Hello everyone, here is my problem:

    I have a friend who has installed Cloudron on his server, and as I needed something to put my site I asked him if it does not bother him to put me an application (LAMP). He proposed me to create a mailbox with roundcube (caranouga@caradev.ml) except that the problem is that the mail function of cloudron does not work!:

    function cloudronmail($to, $subject, $body, $headers)
    {
        $smtp = stream_socket_client('tcp://' . getenv('CLOUDRON_MAIL_SMTP_SERVER') . ':' . getenv('CLOUDRON_MAIL_SMTP_PORT'), $eno, $estr, 30);
    
        $B = 8192;
        $c = "\r\n";
        $s = getenv('CLOUDRON_MAIL_FROM');
    
        fwrite($smtp, 'helo ' . getenv('HOSTNAME') . $c);
            $junk = fgets($smtp, $B);
    
        // Envelope
        fwrite($smtp, 'mail from: ' . $s . $c);
            $junk = fgets($smtp, $B);
        fwrite($smtp, 'rcpt to: ' . $to . $c);
            $junk = fgets($smtp, $B);
        fwrite($smtp, 'data' . $c);
    
            $junk = fgets($smtp, $B);
    
        // Header
        fwrite($smtp, 'To: ' . $to . $c);
        if(strlen($subject)) fwrite($smtp, 'Subject: ' . $subject . $c);
        if(strlen($headers)) fwrite($smtp, $headers); // Must be \r\n (delimited)
        fwrite($smtp, $headers . $c);
    
        // Body
        if(strlen($body)) fwrite($smtp, $body . $c);
        fwrite($smtp, $c . '.' . $c);
            $junk = fgets($smtp, $B);
    
        // Close
        fwrite($smtp, 'quit' . $c);
            $junk = fgets($smtp, $B);
        fclose($smtp);
    }
    

    Here is what I put:

    <?php
    function cloudronmail($to, $subject, $body, $headers)
    {
        $smtp = stream_socket_client('tcp://' . getenv('CLOUDRON_MAIL_SMTP_SERVER') . ':' . getenv('CLOUDRON_MAIL_SMTP_PORT'), $eno, $estr, 30);
    
        $B = 8192;
        $c = "\r\n";
        $s = getenv('CLOUDRON_MAIL_FROM');
    
        fwrite($smtp, 'helo ' . getenv('HOSTNAME') . $c);
            $junk = fgets($smtp, $B);
    
        // Envelope
        fwrite($smtp, 'mail from: ' . $s . $c);
            $junk = fgets($smtp, $B);
        fwrite($smtp, 'rcpt to: ' . $to . $c);
            $junk = fgets($smtp, $B);
        fwrite($smtp, 'data' . $c);
    
            $junk = fgets($smtp, $B);
    
        // Header
        fwrite($smtp, 'To: ' . $to . $c);
        if(strlen($subject)) fwrite($smtp, 'Subject: ' . $subject . $c);
        if(strlen($headers)) fwrite($smtp, $headers); // Must be \r\n (delimited)
        fwrite($smtp, $headers . $c);
    
        // Body
        if(strlen($body)) fwrite($smtp, $body . $c);
        fwrite($smtp, $c . '.' . $c);
            $junk = fgets($smtp, $B);
    
        // Close
        fwrite($smtp, 'quit' . $c);
            $junk = fgets($smtp, $B);
        fclose($smtp);
    }
    
      $headerss = 'From: caranouga@caradev.ml' . "\r\n" .
      'Reply-To: m*********t@gmail.com' . "\r\n" .
      'X-Mailer: PHP/' . phpversion();
    
    cloudronmail("m*********t@gmail.com", "Test", "Test", $headerss);
    echo 'test';
    echo '
    ';
    
    echo getenv('CLOUDRON_MAIL_SMTP_SERVER');
    echo '
    ';
    echo getenv('CLOUDRON_MAIL_SMTP_PORT');
    echo '
    ';
    getenv('CLOUDRON_MAIL_SMTPS_PORT');
    echo '
    ';
    echo getenv('CLOUDRON_MAIL_SMTP_USERNAME');
    echo '
    ';
    echo getenv('CLOUDRON_MAIL_SMTP_PASSWORD');
    echo '
    ';
    echo getenv('CLOUDRON_MAIL_FROM');
    echo '
    ';
    echo getenv('CLOUDRON_MAIL_DOMAIN');
    echo '
    ';
    getenv('HOSTNAME');
    

    and a screen of what it gives: 785b6b2f-076b-4ec3-87db-69284c3ccc27-image.png I would like to know if it is a problem with the cloudron or if I did something wrong

    Thanks in advance for your help,

    Caranouga

    PS: The url of the roundcube is mail.miningheberg.ml, here is a screen of my creditentials.txt file:

    Do not edit this file. It will be overwritten on any update or app restart and is autogenerated.
    
    Sendmail Credentials
    ====================
    
                       PHP usage                               Value
    Hostname:   getenv('CLOUDRON_MAIL_SMTP_SERVER')      mail
    Port:       getenv('CLOUDRON_MAIL_SMTP_PORT')        2525
    TLS Port:   getenv('CLOUDRON_MAIL_SMTPS_PORT')       2465
    Username:   getenv('CLOUDRON_MAIL_SMTP_USERNAME')    caranouga@caradev.ml
    Password:   getenv('CLOUDRON_MAIL_SMTP_PASSWORD')    the_password
    Address:    getenv('CLOUDRON_MAIL_FROM')             caranouga@caradev.ml
    Domain:     getenv('CLOUDRON_MAIL_DOMAIN')           caradev.ml
    
    
    
    
    
    

    I changed my roundcube password to match the password of the creditentials file, but it does not work.
    PS2: I have a last question I look at you I find variables that are not defined: $eno, $estr, etc... Is this normal?

    LAMP
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search