Skip to content

Commit 3a2521d

Browse files
committed
Revert "SmtpMailer: Fix for servers which sends 250-AUTH only through encrypted connections (#67)" [Closes #71]
This reverts commit f001680.
1 parent 1944d33 commit 3a2521d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Mail/SmtpMailer.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,12 @@ protected function connect(): void
155155
stream_set_timeout($this->connection, $this->timeout, 0);
156156
$this->read(); // greeting
157157

158+
$this->write("EHLO $this->clientHost");
159+
$ehloResponse = $this->read();
160+
if ((int) $ehloResponse !== 250) {
161+
$this->write("HELO $this->clientHost", 250);
162+
}
163+
158164
if ($this->secure === 'tls') {
159165
$this->write('STARTTLS', 220);
160166
if (!stream_socket_enable_crypto(
@@ -167,12 +173,6 @@ protected function connect(): void
167173
$this->write("EHLO $this->clientHost", 250);
168174
}
169175

170-
$this->write("EHLO $this->clientHost");
171-
$ehloResponse = $this->read();
172-
if ((int) $ehloResponse !== 250) {
173-
$this->write("HELO $this->clientHost", 250);
174-
}
175-
176176
if ($this->username != null && $this->password != null) {
177177
$authMechanisms = [];
178178
if (preg_match('~^250[ -]AUTH (.*)$~im', $ehloResponse, $matches)) {

0 commit comments

Comments
 (0)