mail() function in php


  • | 685 points

    HI,

    first of all great project and nice and easy to use tool!
    the only thing don't get to work is sending emails with php

    php senders debug log:
    19.11.07 20:26:01 ** --- MESSAGE BEGIN ---
    19.11.07 20:26:01 ** To: xxx@xxx.de
    19.11.07 20:26:01 ** Subject: Hi leokhoa
    19.11.07 20:26:01 **
    19.11.07 20:26:01 ** I like Mail Sender feature.
    19.11.07 20:26:01 ** --- MESSAGE END ---
    19.11.07 20:26:01 ** Message is missing sender's address
    same in error.log
    19.11.07 20:26:01 : Message is missing sender's address

    I can send emails to me through preferences mail sender w/o any problem.

    Above problem seems easy to fix added sender information to mail and the error is another one:
    My script:
    $empfaenger = "myemail@mdomain.com";
    $betreff = "Die Mail-Funktion";
    $from = "From: Server Email mygmail@gmail.com\n";
    $from .= "Reply-To: mygmail@gmail.com\n";
    $from .= "Content-Type: text/html\n";
    $text = "php email - send ok if u can read this";
    $header = array(
    'From' => 'mygmail@gmail.com',
    'Reply-To' => 'mygmail@gmail.com',
    'X-Mailer' => 'PHP/' . phpversion()
    );
    if(mail($empfaenger, $betreff, $text,$header)) {
    echo 'success';

    } else
    { echo 'error';}

    so the debug log says:
    19.11.07 20:30:30 ** --- MESSAGE BEGIN ---
    19.11.07 20:30:30 ** To: xxx@xxx.de
    19.11.07 20:30:30 ** Subject: Die Mail-Funktion
    19.11.07 20:30:30 ** From: xxx@gmail.com
    19.11.07 20:30:30 ** Reply-To: xxx@gmail.com
    19.11.07 20:30:30 ** X-Mailer: PHP/7.2.19
    19.11.07 20:30:30 **
    19.11.07 20:30:30 ** php email - send ok if u can read this
    19.11.07 20:30:30 ** --- MESSAGE END ---
    19.11.07 20:30:30 ** Failed to load SSL libraries: Could not load SSL library.
    19.11.07 20:30:30 ** Connecting to smtp.gmail.com:587
    19.11.07 20:30:30 ** Connected.
    19.11.07 20:30:30 << 220 smtp.gmail.com ESMTP 65sm5299163wrs.9 - gsmtp<EOL>
    19.11.07 20:30:30 >> EHLO laragon.org<EOL>
    19.11.07 20:30:30 << 250-smtp.gmail.com at your service, [93.243.121.88]<EOL>250-SIZE 35882577<EOL>250-8BITMIME<EOL>250-STARTTLS<EOL>250-ENHANCEDSTATUSCODES<EOL>250-PIPELINING<EOL>250-CHUNKING<EOL>250 SMTPUTF8<EOL>
    19.11.07 20:30:30 >> MAIL FROM: xxx@gmail.com<EOL>
    19.11.07 20:30:30 << 530 5.7.0 Must issue a STARTTLS command first. 65sm5299163wrs.9 - gsmtp<EOL>
    19.11.07 20:30:30 ** Disconnecting from smtp.gmail.com:587
    19.11.07 20:30:30 ** Disconnected.
    19.11.07 20:30:30 ** Disconnected.
    19.11.07 20:30:30 ** Must issue a STARTTLS command first. 65sm5299163wrs.9 - gsmtp<EOL>


  • | 685 points

    what can i do ? as I know we are running on openssl 1.1 on php 7.2.19
    the dll files changed but I also tried to put the in to sendmail bin folder the new ones lib-crypt* etc.

    doesn't work at all -
    any help would be great. - struggling with this problem since 2 days and no solution at all ...
    Thx.

    I am running laragon on a windows server 2019 essentials this might be the problem but I don't know how to setup here ssl certificates - to get this thing working.

    php.ini
    extension_dir = "C:/laragon/bin/php/php-7.2.19-Win32-VC15-x64/ext"
    extension=php_openssl

    if I try to enable ssl on apache in the menu i get the error that it cant run the app with an 0x code.


Log in to reply
 

Looks like your connection to Laragon was lost, please wait while we try to reconnect.