HMTL Mail

Ich würde mir wünschen, dass man mit IPSymcon Emails mit HTML Content senden kann und nicht auf externe Tools ausweichen muss.

ja. ich wünsche auch aber mit phpmailer mann kann bischen probieren.

Hast du schön versucht mit anderen externe Tools für Outlook HTML Formated email?

Ich hatte das schon mit PHPMailer versucht, aber bin nicht klargekommen.
Dann habe ich das aufgegeben und hoffte auf eine integrierte Lösung.

Wo ist denn das Problem, wo hängt es denn das ich ja an sich nicht so schwer?

Ich habe die im Anhang gezeigten Dateien mittels WINSCP in das Verzeichnis //Mnt/data/symcon/scripts/ hochgeladen.

Dann noch eine Datei in der Konsole php_mailer_connector.ips.php mit folgendem Inhalt:




<?

// Messaging-Script für PHP-mailer
include("/mnt/data/symcon/scripts/class.phpmailer.php");

//Create a new PHPMailer instance
$mail = new PHPMailer;

################ User-Konfig ###################################################
$mail->Host 			= "smtp.1und1.de";  				// specify main and backup server
$mail->SMTPAuth 		= true;     						// turn on SMTP authentication
$mail->Username 		= "haus@xxx.de";	// SMTP username
$mail->Password 		= "xxx"; 					// SMTP password

################ User-Konfig Ende ##############################################

// Set PHPMailer to use the sendmail transport
$mail->isSendmail();

//Set who the message is to be sent from
$mail->setFrom('haus@xxx.de', 'First Last');

//Set an alternative reply-to address
$mail->addReplyTo('info@xxx.de', 'First Last');

//Set who the message is to be sent to
$mail->addAddress('info@xxx.de', 'John Doe');

//Set the subject line
$mail->Subject = 'PHPMailer sendmail test';

//Read an HTML message body from an external file, convert referenced images to embedded,
//convert HTML into a basic plain-text alternative body
//$mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__));
$mailtext = '<html>
<head>
    <title>HTML-E-Mail mit PHP erstellen</title>
</head>
 
<body>
 
<h1>HTML-E-Mail mit PHP erstellen</h1>
 
<p>Diese E-Mail wurde mit PHP und HTML erstellt</p>
 
<table border="1">
  <tr>
    <td>Beschreibung</td>
    <td>Anzahl Seiten</td>
  </tr>
  <tr>
    <td>PHP lernen mit PHP-Kurs.com</td>
    <td>über 100</td>
  </tr>
</table>
 
<p>Die meisten HTML-Tags wie <b>fett</b>
und <i>kursiv</i> stehen zur
Verfügung</p>
 
</body>
</html>
';

$mail->msgHTML($mailtext);

//Replace the plain text body with one created manually
$mail->AltBody = 'This is a plain-text message body';

//Attach an image file
//$mail->addAttachment('images/phpmailer_mini.png');

//send the message, check for errors
if (!$mail->send()) {
    echo "Mailer Error: " . $mail->ErrorInfo;
} else {
    echo "Message sent!";
}


?>

Dann bekomme ich die Meldung, „could not execute /usr/sbin/sendmail“.

scripts - root@symbox - WinSCP.png

Die Meldung ist doch absolut eindeutig :confused:

Je nach Unix-Image ist kein sendmail enthalten, dass musst du noch installieren.

ich glauche du brauchst $mail->isSendmail(); nicht.

noch frage ob wo hast du autoload.php bekommen? ich brauch autoload.php.

An sich ist das ja nicht so schwer man muss ja nur die Klassen einbinden, aber da vielleicht der ein oder andere es einfacher haben will hier ein Mini Modul
SymconMailer

Ist nur ein Wrapper und nutzt 1:1 PHPMailer, damit gewinne ich wahrscheinlich den Preis für das überflüssigste Modul ;). Zumindest muss man nur die Instanz hinzufügen, Felder ausfüllen und schon sollte man HTML Emails verschicken können.

Danke, werde ich am Wochenende einmal probieren.

Danke nochmals,

die Installation hat geklappt und nun kann ich meine Lottozahlenauswertung nun in einer Tabelle darstellen.