pear / mail_mime Goto Github PK
View Code? Open in Web Editor NEWCreate MIME messages with PHP
Home Page: http://pear.php.net/package/Mail_Mime
Create MIME messages with PHP
Home Page: http://pear.php.net/package/Mail_Mime
This package is http://pear.php.net/package/Mail_Mime and has been migrated from http://svn.php.net/repository/pear/packages/Mail_Mime Please report all new issues via the PEAR bug tracker. If this package is marked as unmaintained and you have fixes, please submit your pull requests and start discussion on the pear-qa mailing list. To test, run either $ phpunit tests/ or $ pear run-tests -r To build, simply $ pear package To install from scratch $ pear install package.xml To upgrade $ pear upgrade -f package.xml
-No change in my example php code below
Example code:
$mime = new Mail_mime(array('eol' => PHP_EOL));
$mime->setTXTBody($text);
$mime->setHTMLBody($html);
$mime_params = array(
'text_encoding' => '7bit',
'text_charset' => 'UTF-8',
'html_charset' => 'UTF-8',
'head_charset' => 'UTF-8'
);
$body = $mime->get($mime_params);
$hdrs = array(
'From' => $from,
'Subject' => $subject,
'To' => $to
);
$hdrs = $mime->headers($hdrs);
$msg = '';
foreach ($hdrs as $key => $val){
$msg .= $key.": ".$val.PHP_EOL;
}
$msg .= PHP_EOL."This is a multi-part message in MIME format.".PHP_EOL;
$msg .= $body;
echo $msg;
//----------------------------------------------------
//correct (expected) result: from 1.10.4
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="=_15b567cd99cd8009c9780e9d7d92e055"
From: XXX [email protected]
Subject: YYY
To: ZZZ
This is a multi-part message in MIME format.
--=_15b567cd99cd8009c9780e9d7d92e055
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=UTF-8
Please view this mail in a HTML-capable mail client
--=_15b567cd99cd8009c9780e9d7d92e055
//-----------------------------------------------------------------------------
Incorrect result (from 1.10.5)
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="=_06f4d55e551f6d0099afe89eaae519b2"
From: XXX [email protected]
Subject: YYY
To: ZZZ
This is a multi-part message in MIME format.
--=_2e148fc164447df3cad439932ec7c841
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=UTF-8
Please view this mail in a HTML-capable mail client
--=_2e148fc164447df3cad439932ec7c841
After upgrading to 1.10.10, I am noticing a strange behaviour: backslash is getting added in the content
Eg:
From: "George B@@z"[email protected] is getting changed to
From: "\"George" B@@z"[email protected]
In the recipient list (To header), there is newline getting added with backslash
"Abel Thomas" [email protected] is getting changed to
"Abel\
Thomas" [email protected]
On PEAR, 1.10.10 has been released, but on packagist, it is still 1.10.9. Please update it.
Can you please upload the 1.10.7 release to https://packagist.org/
(Apologies for logging this here, but the PEAR bug tracker seems to be broken and throws an error when I try to submit a bug.)
There are a few places in the codebase that have recently been updated to remove the middle part of a ternary operator.
For example, in mime.php, line 795 has been changed from:
return $res ? $res : true;
to
return $res ?: true;
This needlessly breaks support for php < 5.3 and should be reverted.
I believe it has something to do with: $n_encoding = null , $f_encoding = null
. But I can't figure out exactly what I'm doing wrong. Any idea on what to put there to make the filename not gibberish?
Great Library otherwise!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.