kostenloser Webspace werbefrei: lima-city


In PHP Variablen per SMPT versenden

lima-cityForumProgrammiersprachenPHP, MySQL & .htaccess

  1. Autor dieses Themas

    theommb

    Kostenloser Webspace von theommb

    theommb hat kostenlosen Webspace.

    Hallo,
    ich mal wieder ein Problem... :wall:

    ich möchte via. SMPT (PHPMailer) Inhalte aus einer MySQL-Datenbank verschicken... aber im Beispiele von PHPMailer sind nur HTML-Dokumente möglich.

    Wie stelle ich das an, dass es trotzdem Daten aus der Datenbank verschickt wird???

    Vielen Dank im Voraus :approve:
  2. Diskutiere mit und stelle Fragen: Jetzt kostenlos anmelden!

    lima-city: Gratis werbefreier Webspace für deine eigene Homepage

  3. Kenne zwar dein genaues Vorhaben nicht, aber wie wäre es wenn du vorher die Daten einfach mittels mysqli ausliest und diese dann einfach mit phpmailer verschickst?
    Versteh dein Problem nicht genau.
  4. Autor dieses Themas

    theommb

    Kostenloser Webspace von theommb

    theommb hat kostenlosen Webspace.

    Danke für die schnelle Antwort, aber

    ich habe mit nutze den Google SMPT Server und in dieem Code:
    require_once('../class.phpmailer.php');
    //include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded
    
    $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->Host       = "smpt.googelmail.com"; // SMTP server
      $mail->SMTPDebug  = 2;                     // enables SMTP debug information (for testing)
      $mail->SMTPAuth   = true;                  // enable SMTP authentication
      $mail->SMTPSecure = "ssl";                 // sets the prefix to the servier
      $mail->Host       = "smtp.gmail.com";      // sets GMAIL as the SMTP server
      $mail->Port       = 465;                   // set the SMTP port for the GMAIL server
      $mail->Username   = "meine Google mail";  // GMAIL username
      $mail->Password   = "Mein_Passwort";            // GMAIL password
      $mail->AddAddress('test@gmail.com', 'John Doe');
      $mail->SetFrom('test@yahoo.de', 'First Last');
     // $mail->AddReplyTo('name@yourdomain.com', 'First Last');
      $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->MsgHTML(file_get_contents('contents.html'));
      $mail->AddAttachment('images/phpmailer.gif');      // attachment
      $mail->AddAttachment('images/phpmailer_mini.gif'); // attachment
      $mail->Send();
      echo "Message Sent OK</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!
    }



    Aber mir istr jetzt noch ne kleine Idee gekommen ich kann ja mit PHP eine HTML Datei erstellen und die dann senden
  5. Diskutiere mit und stelle Fragen: Jetzt kostenlos anmelden!

    lima-city: Gratis werbefreier Webspace für deine eigene Homepage

Dir gefällt dieses Thema?

Über lima-city

Login zum Webhosting ohne Werbung!