Mario: PHPMailer - Embedded Image wird bei GMX nicht angezeigt

Beitrag lesen

Hallo zusammen,

ich habe ein Problem, das mich zur Verzweiflung bring. Google, die Foren und die Dokumentation finden nichts, ausser, daß es bei anderen offenbar problemlos funktioniert.

Ich möchte mit PHPmailer eine HTML Mail mit einem embedded Image losschicken. Funktioniert auch, wenn ich die Mail aber mit GMX anschaue, wird das Bild nicht angezeigt. Rufe ich die Mail dann mit Thunderbird von GMX ab, zeigts mir alles problemlos an, auch in anderen Webmailern wie web.de, yahoo, hotmail oder googlemail wird das Bild angezeigt, nur eben bei GMX nicht. (Ich kann auch nirgends klicken, daß Bilder nachgeladen werden sollen oder sowas in der Art, auch in der Volldarstellung wird nichts angezeigt.) Da ich im Internet bei meiner Suche öfters gelesen habe, daß es in GMX funktioniert, vermute ich, der Fehler liegt bei mir. Ich find ihn nur leider nicht und bin für jede Hilfe dankbar!

viele Grüße,
Mario.

  
<?php  
require_once('class.phpmailer.php');  
  
$mailtext = "  
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>  
  
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>  
<head>  
<meta http-equiv='content-type' content='text/html; charset='UTF-8'>  
</head>  
<body>  
<h1>Hallo!</h1>  
Embedded Image: <img alt='PHPMailer' src='cid:my-attach'> Here is an image!  
</body>  
</html>";  
  
  
  
$mail = new PHPMailer(true); // the true param means it will throw exceptions on errors, which we need to catch  
  
$mail->IsSMTP(); // telling the class to use SMTP  
  
try {  
  $mail->IsSMTP();  
  $mail->Host       = "smtp.XXXXXXXX.de"; // SMTP server  
  $mail->SMTPDebug  = 2;                     // enables SMTP debug information (for testing)  
  $mail->SMTPAuth   = true;                  // enable SMTP authentication  
  $mail->Username = "XXXXXXXX";  
  $mail->Password = "XXXXXXXX";  
  
  $mail->AddAddress('XXXXXXXX@gmx.de', 'John Doe');  
  $mail->SetFrom('XXXXXXXX@XXXXXXXX.de', 'XXXXXXXX@XXXXXXXX.de');  
  $mail->AddReplyTo('XXXXXXXX@XXXXXXXX.de', 'XXXXXXXX@XXXXXXXX.de');  
  
  $mail->AddCC("XXXXXXXXl@XXXXXXXX.com","Donald Duck");  
  $mail->Subject = 'PHPMailer Test Subject via mail(), advanced';  
  $mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically  
  $mail->AddEmbeddedImage('rocks.jpg', 'my-attach', 'rocks.jpg');  
  $mail->IsHTML(true);  
  $mail->Body = $mailtext;  
  $mail->AltBody  =  "Ohh, keine HTML-Mail";  
  $mail->Send();  
  
  echo "Message Sent OK<p></p>\n";  
} catch (phpmailerException $e) {  
  echo $e->errorMessage(); //Pretty error messages from PHPMailer  
} catch (Exception $e) {  
  echo $e->getMessage(); //Boring error messages from anything else!  
}  
?>