function MrPropre($v, $ext = 0, $delimiter = ".") { $v = Accents($v); #if(strpos($v,"http://")){}function illimitée $v = str_replace(array("\t", " "), "", $v); $v = str_ireplace(array("%C3%A9", "%C3%A8", "%E9", "%EA", "%E8", "%i9", "i9", 'i8'), "e", $v); $v = preg_replace("@%.{2}@", "", $v); if (!eregi("2007/", $v)) { #ben old filepath, not to be rewriten touth $v1 = "(){}[]\$%@!?\\|+'~*^¨°`´²§µ£=<>&;–#’ _,:"; $v2 = "......................................."; $v = strtr($v, $v1, $v2); #/: $v = preg_replace("@[^0-9a-z-\\.\\/\\:\\-]@i", "", $v); $v = preg_replace("@[_ ,-]@", ".", $v); $v = str_replace(array(".de.", ".l.", "./.", ",", "%09", "%20"), ".", $v); $v = preg_replace("@\\.{2,}@", ".", $v); $v = str_replace('http.//', 'http://', $v); } #if(!$ext)$v=ereg_replace("\."," ",$v); #$v=strtolower(str_replace(" ",$delimiter,(trim(ereg_replace("[ ]{2,}"," ",$v)))));//UN UNIQUE TIRET SE SUIVANT $v = trim($v, ":-?=&#!¤*.†\t"); return $v; }
function SmtpMail($SmtpServer, $portsmtp = 25, $SmtpUser = '', $SmtpPass = '', $from = '', $to = '', $sub = '', $body = '', $host = H, $html = 0) { if ($SmtpServer == 'a74') { $SmtpServer = 'a74.fr'; } #correction if (is_array($SmtpServer)) { extract($SmtpServer); } $lf = "\r\n"; if (!$from) { $from = $SmtpUser; } #tout d'un block if (strpos($from, '@gmail.com')) { return Gmail($SmtpServer, $portsmtp = 25, $SmtpUser, $SmtpPass, $from, $to, $sub, $body, $host = h); } $body = str_replace("\n", "<br>", $body); #$body=str_replace("\n","\r\n",$body); if ($html) { $body = $lf . 'MIME-Version: 1.0' . $lf . 'Content-type: text/html; charset=iso-8859-1' . $lf . $lf . $body; } else { $body = $lf . $lf . $body; } try { if ($x = fsockopen($SmtpServer, $portsmtp)) { $data = ["EHLO " . $host, 'auth login', base64_encode($SmtpUser), base64_encode($SmtpPass), "MAIL FROM: <{$SmtpUser}>", "RCPT TO: {$to}", "DATA"]; foreach ($data as $z) { fputs($x, $z . $lf); $talk[trim(fgets($x, 1024))] = $z . '_' . time(); } fputs($x, "To: " . $to . $lf . "From: " . $from . $lf . "Subject:" . $sub . $body . $lf . '.' . $lf); $talk[trim(fgets($x, 256))] = 'send'; fputs($x, "QUIT" . $lf); $talk[trim(fgets($x, 256))] = 'quit'; fclose($x); return $talk; } } catch (Exception $e) { return wmail($to, Accents($sub), $e->getMessage() . $body); #Date: 19/12/2009 23:59:59\n } # }