You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.
The purpose of this is for a Mailing List. Basically if the Mailing List is set to be moderated than the email is saved to a file instead of being sent to the recipient list. Once the email has been approved then a command is sent to the server to have this email sent. So the script example reads the file and sends it.
working_text.txt - is a text email only, it contains no images. This works as expected with the test.php file and the email is read from file and sent to the recipient.
working_mime.txt - This is the same file as notworking_mime.txt except I manually edited it and only removed This is a message in Mime Format. If you see this, your mail reader does not support this format. and then resaved the message. Once this line is removed, the message is sent as expected.
notworking_mime.txt - This contains text and a single (clean) image. This does not work when attempting to be read. When trying to open and read this file the following is sent to the error log:
"does not match header format!' in /usr/local/apache/vhosts/otwebsoft_worker/vendor/Zend/Mail/Headers.php:87ption' with message 'Line "This is a message in MimeFormat. If you see this, your mail reader does not support this format.
Stack trace:
#0 /usr/local/apache/vhosts/otwebsoft_worker/vendor/Zend/Mime/Decode.php(141): Zend\Mail\Headers::fromString('Date: Fri, 01 M...', '?')#1 /usr/local/apache/vhosts/otwebsoft_worker/vendor/Zend/Mail/Storage/Part.php(99): Zend\Mime\Decode::splitMessage('Date: Fri, 01 M...', 'Date: Fri, 01 M...', '??--=_e8be6ee00...', '?', false)#2 /usr/local/apache/vhosts/otwebsoft_worker/vendor/Zend/Mail/Storage/Message.php(52): Zend\Mail\Storage\Part->__construct(Array)#3 /usr/local/apache/vhosts/otwebsoft_worker/scripts/test.php(16): Zend\Mail\Storage\Message->__construct(Array)#4 {main}
thrown in /usr/local/apache/vhosts/otwebsoft_worker/vendor/Zend/Mail/Headers.php on line 87
The text was updated successfully, but these errors were encountered:
$test = file_get_contents('D:/data/mail/BrokenMail.eml'); // no difference with txt except that eml is openable with Outlook$test = preg_replace('~\R~u', "\r\n", $test); // replace "\n" and "\r" with "\r\n"$mail = Zend\Mail\Message::fromString($test);
The purpose of this is for a Mailing List. Basically if the Mailing List is set to be moderated than the email is saved to a file instead of being sent to the recipient list. Once the email has been approved then a command is sent to the server to have this email sent. So the script example reads the file and sends it.
I've created a Gist which includes a test and several examples to try:
https://gist.github.com/diemuzi/5073563
In the gist you'll find:
test.php
working_text.txt
working_mime.txt
notworking_mime.txt
The emails were saved using http://zf2.readthedocs.org/en/latest/modules/zend.mail.file.options.html
A brief explanation of these files:
working_text.txt - is a text email only, it contains no images. This works as expected with the test.php file and the email is read from file and sent to the recipient.
working_mime.txt - This is the same file as notworking_mime.txt except I manually edited it and only removed This is a message in Mime Format. If you see this, your mail reader does not support this format. and then resaved the message. Once this line is removed, the message is sent as expected.
notworking_mime.txt - This contains text and a single (clean) image. This does not work when attempting to be read. When trying to open and read this file the following is sent to the error log:
The text was updated successfully, but these errors were encountered: