- D1Rect: Nagy "hülyétkapokazapróktól" topik
- koxx: Az e-sport napistenének ajándéka: Lamzu Inca gamer egér
- GoodSpeed: AMD Ryzen 9 9900X (100-100000662WOF)+ Samsung 990 PRO 2TB MZ-V9P2T0BW
- Luck Dragon: Asszociációs játék. :)
- sziku69: Fűzzük össze a szavakat :)
- laskr99: Processzor és videokártya szilícium mag fotók újratöltve!
- Real Racing 3 - Freemium csoda
- Gurulunk, WAZE?!
- eBay-es kütyük kis pénzért
- bitpork: Phautós tali a Balcsinál 2025 Augusztus 2 napján (szombat)
Hirdetés
Köszönjük a sok biztatást, támogatást! Utolsó pillanat a féláras hirdetésfeladásra, előfizetésre!
Új hozzászólás Aktív témák
-
vakondka
őstag
Sziasztok,
Van egy php progim, eddig tök jól működött, de most egy másik szerveren folyton elhasal,
valószínüleg azért, mert ott php 5.2.6 van ahol eddig ment hibátlanul ott pedig PHP 4.4Ezt írja ki:
Catchable fatal error: Object of class PHPMailerExt could not be converted to string in /xxxxx.php on line 88
a 88. sorban ez van az xxxxx.phpben:
echo "<font size=\"3\" color=\"#ff0000\">Nem lett elküldve:".$mail."</FONT>". $mail->ErrorInfo."<br>";
és a class PHPMailerExt:
class PHPMailerExt extends PHPMailer
{
/**
*/
function GetImageMimeType($name)
{
$ext = substr($name, strrpos($name, '.')+1);
switch(strtolower($ext)) {
case 'jpg':
case 'jpeg':
return 'image/jpeg';
case 'gif':
return 'image/gif';
case 'png':
return 'image/png';
default:
trigger_error('PHPMailer->GetImageMimeType: not supported image type:'+$ext, E_USER_WARNING);
return 'application/octet-stream';
}
}
function ConvertImgToEmbeddedImage()
{
$matches = array();
preg_match_all('/<img[^>]+src="([^"]+)"[^>]*>/ms',
$this->Body, $matches, PREG_SET_ORDER);
if (count($matches)) {
foreach($matches as $match) {
$urls[] = $match[1];
}
$urls = array_unique($urls);
for($i = 0, $count = count($urls); $i <
$count; $i++) {
$this->Body = preg_replace(
'/(<img\s+[^>]*src=")'.preg_quote($urls[$i], '/').'/',
'$1cid:image'.($i+1),
$this->Body
);
$this->AddEmbeddedImage($urls[$i],
'image'.($i+1), "", "base64", $this->GetImageMimeType($urls[$i]));
}
}
}
/**
* Creates message and assigns Mailer. If the message is
* not sent successfully then it returns false. Use the
ErrorInfo
* variable to view description of the error.
* @return bool
*/
function FetchMail() {
$header = "";
$body = "";
$result = true;
if((count($this->to) + count($this->cc) +
count($this->bcc)) < 1)
{
$this->SetError($this->Lang("provide_address"));
return false;
}
// Set whether the message is multipart/alternative
if(!empty($this->AltBody))
$this->ContentType =
"multipart/alternative";
$this->error_count = 0; // reset errors
$this->SetMessageType();
$header .= $this->CreateHeader();
$body = $this->CreateBody();
if($body == "") { return false; }
return array($header, $body);
}
function AddEmbeddedImage($path, $cid, $name = "", $encoding= "base64",$type ="application/octet-stream") {
// <change>
// <original>
//if(!@is_file($path))
//{
// $this->SetError($this->Lang("file_access") .$path);
// //return false;
//}
// </original>
// <extended>
if(!($file = @fopen($path, 'rb'))){
$this->SetError($this->Lang("file_access") .$path);}
else {fclose($file);}
// </extended>
// </change>
$filename = basename($path);
if($name == "")$name = $filename;
// Append to $attachment array
$cur = count($this->attachment);
$this->attachment[$cur][0] = $path;
$this->attachment[$cur][1] = $filename;
$this->attachment[$cur][2] = $name;
$this->attachment[$cur][3] = $encoding;
$this->attachment[$cur][4] = $type;
$this->attachment[$cur][5] = false;
//isStringAttachment
$this->attachment[$cur][6] = "inline";
$this->attachment[$cur][7] = $cid;
return true;
}
/**
* Encodes attachment in requested format. Returns an
* empty string on failure.
* @access private
* @return string
*/
function EncodeFile ($path, $encoding = "base64") {
if(!@$fd = fopen($path, "rb"))
{
$this->SetError($this->Lang("file_open") .$path);
return "";
}
// <change>
// <original>
// $file_buffer = fread($fd, filesize($path));
// </original>
// <extended>
if ($size = (int)@filesize($path)) {
$file_buffer = fread($fd, $size);
} else {
$file_buffer = '';
while (!feof($fd)) {
$file_buffer .= fread($fd, 1024);
}
}
// </extended>
// </change>
$file_buffer = $this->EncodeString($file_buffer,$encoding);
fclose($fd);
return $file_buffer;
}
}bármi ötlet ?
Új hozzászólás Aktív témák
- Audi, Cupra, Seat, Skoda, Volkswagen topik
- D1Rect: Nagy "hülyétkapokazapróktól" topik
- Garmin Venu X1 - vékony, virtuóz, váltságíjas
- OnePlus Nord 2 5G - észak-északkelet
- AMD K6-III, és minden ami RETRO - Oldschool tuning
- Azonnali fotós kérdések órája
- Anglia - élmények, tapasztalatok
- Battlefield 6
- Bittorrent topik
- Android alkalmazások - szoftver kibeszélő topik
- További aktív témák...
- Lenovo T495S Touch (érintő képernyő) AMD Ryzen 5 Pro 3500U, 12 hónap garancia, áfás számla
- HP ZBook Studio 15" G8 - i9 / 1TB / 32GB / 4GB NVIDIA
- Sencor Mobilklíma (Wifi) sac-mt7049c
- Asus F15 FX507 15.6" FHD IPS i7-12700H RTX 4070 32GB 512GB NVMe magyar vbill gar
- Garanciális Gamer Számítógép, PC (RX 6600 8GB, Ryzen 5 3600,16GB RAM, SSD) Beszámítás! Posta ok (31)
- GYÖNYÖRŰ iPhone 13 mini 256GB Midnight -1 ÉV GARANCIA - Kártyafüggetlen, MS3043, 94% Akkumulátor
- Gamer PC- Számítógép! Csere-Beszámítás! I3 10100F / RTX 2060 / 32GB DDR4 / 500GB SSD
- LicencAruhaz.hu OLCSÓ, LEGÁLIS SZOFTVEREK AZONNAL - Windows - Office - Win Server - ÖRÖK GARANCIÁVAL
- Telefon felvásárlás!! Samsung Galaxy A22/Samsung Galaxy A23/Samsung Galaxy A25/Samsung Galaxy A05s
- Samsung Galaxy Tab A8 32GB, Újszerű, 1 Év Garanciával
Állásajánlatok
Cég: FOTC
Város: Budapest