Hirdetés
- Külföldi prepaid SIM-ek itthon
- Samsung Galaxy S24 Ultra - ha működik, ne változtass!
- Örömkönnyek és üres kezek a TriFold startjánál
- iPhone topik
- Hazai akkumulátorrekordra pályázik a OnePlus 15R
- Google Pixel topik
- Xiaomi 15 - kicsi telefon nagy energiával
- Android szakmai topik
- Magisk
- Kezünkben a OnePlus 15 és az Oppo Find X9-ek
Ú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.4
Ezt í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
- Kodi és kiegészítői magyar nyelvű online tartalmakhoz (Linux, Windows)
- One otthoni szolgáltatások (TV, internet, telefon)
- Kolondrum: Oneplus 13 vagy IQOO 13 vagy Oppo Find X8 PRO
- Napelem
- Luck Dragon: Asszociációs játék. :)
- OLED TV topic
- AMD vs. INTEL vs. NVIDIA
- PlayStation 5
- TCL LCD és LED TV-k
- Apple asztali gépek
- További aktív témák...
- Logitech g25
- ZEBRA XPLORE iX125R1 12.5" ÜTÉS ÉS POR ÁLLÓ Windows TABLET ( i5-6200, 8G/256/LTE/GPS ) GARANCIÁVAL
- BESZÁMÍTÁS! ASUS B450 R5 2600X 8GB DDR4 250GB SSD 120GB SSD GTX 1050Ti 4GB Gamdias Argus E1 400W
- BESZÁMÍTÁS! ASUS B650M R7 8700F 32GB DDR5 1TB SSD RTX 4070 Super 12GB NZXT H510 Cougar 700W
- HP 250R G10 (A23MMEA) - 15,6" FullHD IPS - Intel 120U - 32GB DDR4 RAM - 512GB SSD - WIN11 - Garis
- Lenovo magyar laptop billentyűzetre van szükséged? Akármelyik verzióban segítünk!
- GYÖNYÖRŰ iPhone 12 Mini 128GB Blue-1 ÉV GARANCIA -Kártyafüggetlen, MS4209, 94% Akksi
- Samsung Galaxy S22 Ultra 5G 512GB, Kártyafüggetlen, 1 Év Garanciával
- Panasonic CF-20 ütésálló, ipari notebook & tablet számlával, garanciával
- ÁRGARANCIA!Épített KomPhone i5 12400F 16/32/64GB RAM RTX 5060 Ti 16GB GAMER PC termékbeszámítással
Állásajánlatok
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest
Cég: ATW Internet Kft.
Város: Budapest




