1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-13 18:14:07 +02:00

Send e-mail by Ctrl+Enter (Editor)

This commit is contained in:
Jakub Vrana
2011-05-04 11:42:46 +02:00
parent b6be64e9c0
commit daf85306a5
3 changed files with 16 additions and 9 deletions

View File

@@ -16,12 +16,12 @@ function email_header($header) {
* @param array
* @return bool
*/
function send_mail($email, $subject, $message, $from = "", $files = array("error" => array())) {
function send_mail($email, $subject, $message, $from = "", $files = array()) {
$eol = (strncasecmp(PHP_OS, "win", 3) ? "\n" : "\r\n"); // PHP_EOL available since PHP 4.3.10 and 5.0.2
$message = str_replace("\n", $eol, wordwrap(str_replace("\r", "", "$message\n")));
$boundary = uniqid("boundary");
$attachments = "";
foreach ($files["error"] as $key => $val) {
foreach ((array) $files["error"] as $key => $val) {
if (!$val) {
$attachments .= "--$boundary$eol"
. "Content-Type: " . str_replace("\n", "", $files["type"][$key]) . $eol