Thank you Joseph - that helped a lot. Then, everything just works fine :).
Laktasekampagne
Posts
-
PHPMailer - SMTP Error: Could not connect to SMTP host. STARTTLS command failed Unrecognized command -
PHPMailer - SMTP Error: Could not connect to SMTP host. STARTTLS command failed Unrecognized commandHi Joseph,
sorry for being unclear here - the mail is being send out if I set $mail->SMTPSecure = ''; like in the example mail at https://docs.cloudron.io/apps/lamp/#email. However, once setting it to $mail->SMTPSecure = 'tls'; I get the error above.
Will $mail->SMTPSecure = ''; use TLS anyways if the outbound relay is configured to do so?
-
PHPMailer - SMTP Error: Could not connect to SMTP host. STARTTLS command failed Unrecognized commandHi there,
I am trying to send a mail via SMTP and PHPMailer.
The script works fine unless I try to set SMTPSecure to tls. This causes_"SMTP Error: Could not connect to SMTP host. STARTTLS command failed Unrecognized command"
587 is set as port and the outbound relay is looking okay.If someone could point me in a good direction, I would be very thankful :).
Remaining arguments:
$mail = new PHPMailer(true);
$mail->isSMTP();
$mail->Host = getenv('CLOUDRON_MAIL_SMTP_SERVER');
$mail->SMTPAuth = true;
$mail->Username = getenv('CLOUDRON_MAIL_SMTP_USERNAME');
$mail->Password = getenv('CLOUDRON_MAIL_SMTP_PASSWORD');
$mail->SMTPSecure = '';
$mail->Port = getenv('CLOUDRON_MAIL_SMTP_PORT');$mail->setFrom(getenv('CLOUDRON_MAIL_FROM'), 'Mailer'); $mail->addReplyTo($email, 'Hello back'); $mail->addAddress('dummymail@dummy.com', 'Cloudron Test'); $mail->Subject = 'Hello World'; $mail->Body = json_encode($content, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE); $mail->CharSet = 'UTF-8'; $mail->Encoding = 'base64';