Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Windows 10/PHP7 Lone CR/LF Exception #115

Open
tomshaw opened this issue Sep 17, 2016 · 2 comments
Open

Windows 10/PHP7 Lone CR/LF Exception #115

tomshaw opened this issue Sep 17, 2016 · 2 comments

Comments

@tomshaw
Copy link

tomshaw commented Sep 17, 2016

On my windows 10/PHP 7 box I'm getting this error. This error does not effect our dev/production unix servers.

Unable to send mail: mail(): SMTP server response: 550 5.6.0 Lone CR or LF in headers (see RFC2822 section 2.2)

I don't think there is anything wrong with the code that is simply rendering a template.

$viewRenderer = $this->getServiceLocator()->get('ViewRenderer');

$content = $viewRenderer->render($template, $data);

$html = new MimePart($content);
$html->type = Mime::TYPE_HTML;
$html->charset = 'utf-8';
$html->encoding = Mime::ENCODING_8BIT;

$body = new MimeMessage();
$body->setParts([$html]);

$message = new Message();
$message->setSubject($data['subject']);
$message->setBody($body);
$message->setTo($data['to']);
$message->setFrom($config['noreply']['email'], $config['noreply']['name']);
$message->setEncoding('UTF-8');

$transport = new Sendmail();

$transport->send($message);
@tomshaw
Copy link
Author

tomshaw commented Sep 17, 2016

Just tested PHP 5.6 same machine works fine. Looks like this is solely PHP 7 issue.

@michalbundyra
Copy link
Member

This repository has been closed and moved to laminas/laminas-mail; a new issue has been opened at laminas/laminas-mail#48.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants