diff --git a/smtp.php b/smtp.php index 45e6e97..5d456ad 100644 --- a/smtp.php +++ b/smtp.php @@ -159,6 +159,10 @@ class smtp $this->putLine ("DATA\r\n"); if (substr ($completeMail, -2) !== "\r\n") $completeMail .= "\r\n"; + // Dot on first column : must be doubled to not be detected as the end + // of SMTP transaction. The SMTP server will remove it before distribute + // http://tools.ietf.org/html/rfc5321#section-4.5.2 + $completeMail = preg_replace ("#^\.#m", "..", $completeMail); return $this->putLine ("$completeMail.\r\n"); }