Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

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.

send email - smtphost ?

Featured Replies

hello

sorry, my english is bad ...

I want to send an email without authentification, but without succes

I have configured IIS and SMTP

I use this code

import javax.mail.*;

import javax.mail.internet.*;

Properties props = new Properties();

props.setProperty("mail.smtp.host", smtpHost);

MimeMessage msg = new MimeMessage(Session.getDefaultInstance(props));

Multipart content = new MimeMultipart();

MimeBodyPart bodyPart = new MimeBodyPart();

bodyPart.setText(body);

content.addBodyPart(bodyPart);

msg.setContent(content);

msg.setSubject(subject);

msg.setFrom(new InternetAddress(from));

msg.setRecipient(Message.RecipientType.TO, new InternetAddress(to));

Transport.send(msg);

return true;

my parameters are ;)

- from :P [email protected]

- to : [email protected]

- subject : Test

- Body : MyTest

- smtpHost : 192.168.4.1

this smtpHost works with outlook

but Error :

java.net.UnkwonHostException: your_smtp_server.com

I forgot something ?

thanks

Looks like your smtpHost parameter is set to "your_smtp_server.com" replace the value for that parameter with the IP address.

  • Author

I'm sorry but I don't understand your reponse.

I do what ;)

import javax.mail.*;

import javax.mail.internet.*;

Properties props = new Properties();

props.setProperty("mail.smtp.host", [color:orange]"192.168.4.1");

MimeMessage msg = new MimeMessage(Session.getDefaultInstance(props));

Multipart content = new MimeMultipart();

MimeBodyPart bodyPart = new MimeBodyPart();

bodyPart.setText(body);

content.addBodyPart(bodyPart);

msg.setContent([color:orange]"body");

msg.setSubject([color:orange]"subject");

msg.setFrom(new InternetAddress([color:orange][email protected]));

msg.setRecipient(Message.RecipientType.TO, new InternetAddress([color:orange][email protected]));

Transport.send(msg);

return true;

ok, looks like in your last post you are now "hardcoding" the smpt server address. Is this working for you? What error are you getting?

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

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.