Skip to content

Commit

Permalink
Changing EHLO message with from dns hostname.
Browse files Browse the repository at this point in the history
  • Loading branch information
Stéphane Bauland committed Apr 15, 2016
1 parent 2a75c3d commit dc5a572
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/EmailValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ private function send($message) {
if ($result === false) {
throw new Exception('Failed to write to socket for message : '.$message);
}

$text = $line = $this->recv();
while (preg_match("/^[0-9]+-/", $line) || !strncmp($line, '220', 3)) {
$line = $this->recv();
Expand Down Expand Up @@ -144,7 +144,7 @@ private function check() {
try {
if ($this->connect($mxrecord)) {
// TODO replace foo.com with fromemail domain.
$this->send('EHLO foo.com');
$this->send('EHLO '.explode('@', $this->_from)[1]);
$this->send('NOOP');
foreach ($domain['emails'] as $email => $status) {
$this->send('MAIL FROM: <'.$this->_from.'>');
Expand Down

0 comments on commit dc5a572

Please sign in to comment.