Einzelnen Beitrag anzeigen
  #1  
Alt 18.05.2004, 10:18:10
stefansvw stefansvw ist offline
Anfänger
 
Registriert seit: May 2004
Beiträge: 4
content-id (cid) ???

Hallo,

habe folgende Frage an Euch und hoffe das Ihr mir eine Lösung anbieten könnt.

Möchte per PHP Newsletter verschicken aber nur wenn alle Bilder des Newsletters in die Email eingebunden werden also per cid.

Wie kann ich das realisieren ?

Es wird dafür htmlMimeMail in Verbindung mit einer mail_function benutzt.

Der Sourcecode dieser mail_function selbst sieht bisher so aus:
Es funktioniert ja alles gut bis halt auf die Bilder :-(

PHP-Code:
<?php
class mail_class
{
  function 
header($mail_modus$attachment$attachment_file)
  {
    global 
$options;

    
$header "From: $options[name_mail] <$options[email]>n";
    
$header .= "Return-Path: <$options[email]>n";

    if(
$attachment && $attachment_file)
    {
      
$header .= "MIME-version: 1.0n";
      
$header .= "Content-type: multipart/mixed; boundary="Message-Boundary"nn";
    }
    else
    {
      if(
$mail_modus == "html")
      {
        
$header .= "Content-Type: text/htmln";
        
$header .= "Content-Transfer-Encoding: 8Bitn";
      }
      else
      {
        
$header .= "Content-Type: text/plainn";
        
$header .= "Content-Transfer-Encoding: 8Bitn";
      }
    }
    return 
$header;
  }

  function 
body_begin($mail_modus)
  {
    
$body "--Message-Boundaryn";

    if(
$mail_modus == "html"$body.= "Content-type: text/html; charset=iso-8859-1n";
    else 
$body.= "Content-type: text/plain; charset=iso-8859-1n";

    
$body.= "Content-transfer-encoding: 8Bitnn";

    return 
$body;
  }

  function 
body_end($file_name$file_type)
  {
    
$file_size filesize($file_name);

    
$fp fopen($file_name"r");
    
$contents fread($fp$file_size);
    
$encoded_file chunk_split(base64_encode($contents));
    
fclose($fp);

    
$body "nn--Message-Boundaryn";
    
$body.= "Content-type: $file_type; name="$file_name"n";
    
$body.= "Content-Transfer-Encoding: BASE64n";
    
$body.= "Content-Disposition: attachment; filename="$file_name"nn";
    
$body.= "$encoded_filen";
    
$body.= "--Message-Boundary--n";

    return 
$body;
  }

  function 
attachment_message($mail_modus$file_name$file_type$message)
  {
    
$message $this->body_begin($mail_modus) . $message $this->body_end($file_name$file_type);

    return 
$message;
  }

  function 
removal_direction($mail_modus)
  {
    global 
$options;

    if(
$_POST["mail_modus"] == "html"$direction "<br>n<br>n-----------<br>n" str_replace("{firstnews}""<a href="". $options["url"] . "" target="_blank">" $options["url"] . "</a>"nl2br($options["remove_notice"]));
    else 
$direction "nn-----------n" str_replace("{firstnews}"$options["url"], $options["remove_notice"]);

    return 
$direction;
  }

  function 
simple_textmail()
  {
    global 
$options;

    
$header "From: $options[name_mail] <$options[email]>n";
    
$header .= "Return-Path: <$options[email]>n";
    
$header .= "MIME-Version: 1.0n";
    
$header .= "Content-Type: text/plain; charset="iso-8859-1"n";
    
$header .= "Content-Transfer-Encoding: 7bit";

    return 
$header;
  }


}

?>

Kann mir jemand helfen ????

Danke Euch im vorraus
Mit Zitat antworten