Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Datei per Email Anhang senden

Empfohlene Antworten

Veröffentlicht

Hallo,

ich hab ein Programm geschrieben, welches PC's in unserem Netzwerk anpingt un die Ergebnisse (erreichbar/nicht erreichbar) in ein Logfile schreibst.

Jetzt möchte ich das Logfile als Anhang per Email an meine Email Adresse schicken. Habe es bis jetzt geschafft, das er den Text aus der Logdatei als Email Text nimmt. Damit es aber ordentlicher aussieht, möchte ich die Datei als Anhang verschicken.

use Net::SMTP; 
$mailServer = "172.24.128.190";

$nachricht = "test";
$absender = "email\@emai.com";
$betreff = "Ping Notebooks, LogDatei";
$empfaenger = "email\@email";



$smtp = Net::SMTP->new($mailServer);

$smtp->mail($absender);
$smtp->to($empfaenger);

$smtp->data();
$smtp->datasend("Subject: $betreff\n");
$smtp->datasend("To: $empfaenger\n");
$smtp->datasend("\n");

$smtp->dataend();
$smtp->quit;
}[/PHP]

Vielen Dank und schönen Sonntag noch.

Da wird wohl das Net::SMTP Modul nicht ausreichen.

Da du einen Anhang iirc MIME-kodieren mußt, solltest du dir mal ein Modul wie z.B. MIME::Lite ansehen und damit deine Nachricht aufbauen, die du dann über Net::SMTP verschickst.

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.