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.

eMail-Versand

Empfohlene Antworten

Veröffentlicht

Hallo,

Ich habe folgendes Problem.

Wie Versende ich am einfachsten aus einem Applet eine eMail z.B über eine SMTP-Verbindung?

Danke

Danke, du hast nicht noch zufällig ein kleines Beispie?

Folgender Code funktioniert in JSP:

---- snip ----

Properties props = new Properties();

javax.mail.Session mySession;

Message msg;

String sMail_From = "sender@myServer.com";

String sMail_To = "recipient@hisServer.com";

String sMail_Subject = "my subject";

String sMail_Content = "my content";

String sMail_SMTPHost = "mail.server.com";

mySession = javax.mail.Session.getInstance(props, null);

props.put("mail.smtp.host", sMail_SMTPHost);

mySession.setDebug(true);

MimeMessage mimemessage = new MimeMessage(mySession);

mimemessage.setFrom(new InternetAddress(sMail_From));

mimemessage.setRecipients(javax.mail.Message.RecipientType.TO,

InternetAddress.parse(sMail_To, false));

mimemessage.setHeader("Content-Transfer-Encoding", "quoted-printable");

mimemessage.setSubject(sMail_Subject, "iso-8859-1");

mimemessage.setText(sMail_Content, "iso-8859-1");

mimemessage.saveChanges();

/* for debugging only

out.println ("Sending mail with following data:<br>");

out.println ("Sender = " + sMail_From + "<br>");

out.println ("Recipient = " + sMail_To + "<br>");

out.println ("Subject = " + sMail_Subject + "<br>");

out.println ("Content = " + sMail_Content + "<br>");

out.println ("Host = " + sMail_SMTPHost + "<br>");

*/

Transport.send(mimemessage);

---- snip ----

Den kannst du als Basis für dein Applet nehmen.

Gruß, Löti.

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.