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


    Cloudron Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular

    Cannot send mail from LAMP app

    LAMP
    3
    8
    277
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • andres.moya
      andres.moya last edited by

      I'm trying to configure a php application installed into a LAMP app in cloudron, to send emails.

      I'm following instructions here and have typed the "cloudronmail" function as stated there. But it does not send any email. I have added traces to see the commands executed and the responses, and there are (i've edited out the personal information):

      helo <some identifier>
      > 220 my.example.com ESMTP Haraka/2.8.28 ready
      mail from: myapp.app@example.com
      > 250 my.example.com Hello <some identifier>.cloudron [172.18.16.4]Haraka is at your service.
      rcpt to: some.email@hotmail.com
      > 250 sender <myapp.app@example.com> OK
      data
      > 550 I cannot deliver mail for <some.email@hotmail.com>
      To: some.email@hotmail.com
      (...)
      > 503 RCPT required first
      quit
      > 500 Unrecognized command
      

      The address "some.email@hotmail.com" is a valid address of one of the cloudron users (although i think this should not be necessary).

      Do you have any clue? Don't understand why it "cannot deliver mail" for this address. Thanks.

      girish 1 Reply Last reply Reply Quote 0
      • girish
        girish Staff @andres.moya last edited by

        @andres-moya the example in the docs seems wrong because it doesn't send use SMTP auth at all. Let me try to fix up the example tomorrow. The CLOUDRON_MAIL_SMTP_USERNAME and CLOUDRON_MAIL_SMTP_PASSWORD env variables must be used.

        1 Reply Last reply Reply Quote 0
        • Moved from Support by  girish girish 
        • andres.moya
          andres.moya last edited by

          Ok, finally I managed to solve my immediate problem in a different way. But it still be useful to be able to send emails from the PHP app. I cannot try this now, but I'll try again next time we need to do it.

          1 Reply Last reply Reply Quote 0
          • girish
            girish Staff last edited by

            I have updated the docs to use PHPMailer - https://docs.cloudron.io/apps/lamp/#email . PHPMailer supports SMTP authentication.

            hollosch 1 Reply Last reply Reply Quote 1
            • hollosch
              hollosch @girish last edited by

              @girish Hi, how/where to configure the phpmailer after install?

              girish 1 Reply Last reply Reply Quote 0
              • girish
                girish Staff @hollosch last edited by

                @hollosch you have to configure it in the code. https://docs.cloudron.io/apps/lamp/#email has an example. I assume you are using a custom app that you developed?

                hollosch 2 Replies Last reply Reply Quote 1
                • hollosch
                  hollosch @girish last edited by

                  @girish said in Cannot send mail from LAMP app:

                  @hollosch you have to configure it in the code. https://docs.cloudron.io/apps/lamp/#email has an example. I assume you are using a custom app that you developed?

                  ah, that means I have to adjust the configuration in the PHP script I'm using, doesn't it?

                  1 Reply Last reply Reply Quote 0
                  • hollosch
                    hollosch @girish last edited by

                    @girish said in Cannot send mail from LAMP app:

                    @hollosch you have to configure it in the code. https://docs.cloudron.io/apps/lamp/#email has an example. I assume you are using a custom app that you developed?

                    I'm using https://www.php-guestbook.de/?langu=en

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post
                    Powered by NodeBB