javamail

Why JavaMail connection timeout is too long

回眸只為那壹抹淺笑 提交于 2020-01-11 20:58:15
问题 In my application I connect to server to authenticate users. This is code: try { Properties prop = new Properties(); prop.put("mail.smtp.starttls.enable","true"); prop.put("mail.smtp.auth", "true"); prop.put("mail.smtp.connectiontimeout", 1000); Session session = Session.getInstance(prop, null); Transport transport = session.getTransport("smtp"); transport.connect("mion.elka.pw.edu.pl", 587, registerLog, registerPass); transport.close(); return true; } catch (NoSuchProviderException ex) {

Using Thread with Vaadin?

谁说我不能喝 提交于 2020-01-10 03:57:32
问题 I'm trying to use Thread in my project to send emails. When I click on a Button , a Thread is started and a ProgressBar is displayed. As soon as all mails are sent, the ProgressBar doesn't disappear. This is my code: Button btnSendMail = new Button("Mail"); btnSendMail.addClickListener(this); @Override public void buttonClick(ClickEvent event) { if(event.getButton() == btnSendMail){ sendMail(); } } } private void sendMail(){ List<String> list = new ArrayList<String>(); list.add("mymail@domain

I want to use Gmail within my website to send and receive mails. How can i Achieve that?

笑着哭i 提交于 2020-01-07 09:32:57
问题 I am having a website written in JAVA SPRING and HIBERNATE . I want to integrate gmail as apart of my website where my logged in users can use their gmail within my website. How can i do this? Is there any way to create any mail server instead using gmail? Anyway my aim is to send and receive mails within the logged in users , it will be helpful if that is achieved by gmail coz everything is cool there. 回答1: In order to do that, you need to follow the documentation for OAUTH2 at google. https

How to put message into Sent? [closed]

自古美人都是妖i 提交于 2020-01-07 05:03:49
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . After sending the message with JavaMail by smtp, how to put it into the Sent folder(IMAP)? What about the non-english mail(ex: in Russian sent=отправленные)? Is there a way to get the name of the "sent" folder programmatically? 回答1: Folder.appendMessages() There's no standard name for the "sent" folder.

mail is sent successfully or not by java mail api

不羁岁月 提交于 2020-01-06 17:09:07
问题 I have written below a program to send an mail through java mail api which send the mail now my query is to handle the exceptional scenarios also lets say if mail is not sent then i have to da something and if mail is send i have to do some other thing in that cas , now please advise does java mail api proved us any parameter while sending the mail buy which we can check that mail is been sent successfully or not as i have enabled the debugging in my program emailSession.setDebug(true);

Receiving mail using javamail API

眉间皱痕 提交于 2020-01-06 13:26:11
问题 i am using javamail api to configure a receiver but its throwing an exception. i don't know how to resolve it. i am just a beginner to javamail. i am actaully not getting what exactly it wants me to do. please anybody give me the proper solution. my code is: package com.message; import javax.mail.*; import java.util.*; import java.io.*; public class Receiver { public static void main(String[] args) { Properties props = new Properties(); String host = "pop3.gmail.com"; String username =

javamail NTLM authentication using credentials of current user

限于喜欢 提交于 2020-01-06 03:13:47
问题 How can I use the JavaMail API with NTLM authentication to an Exchange server without having to specify user name and password but instead automatically use the credentials of the currently logged-in user? ("single sign on") My intention is to let my client program (which runs on Windows machines in my company's network) to be able to send email without having to specify credentials and without having to allow relay for computers in the network due to security concerns. (In the end I would

Can't connect to SMTP server with Java

岁酱吖の 提交于 2020-01-05 23:20:54
问题 I want to send an email from Java using the Java Mail API (javax.mail.*). I can access the SMTP-server via Thunderbird with the following settings: Server: math.uni-freiburg.de Port: 465 Username: MY_USERNAME Authentification: password, normal Security: SSL/TLS I know nothing else about the SMTP server. With my code I always get the error: Could not connect to SMTP host: math.uni-freiburg.de, port: 465, response: -1 String SMTP_HOST = "math.uni-freiburg.de" String SMTP_USER = "MY_USERNAME

Sending 120 mails by Javamail using Gmail account, but got exception after 80/90 mails

不羁岁月 提交于 2020-01-05 12:09:20
问题 Got the below exception while send mails in a loop of 120. First 80/85 mails are success but the remaining got exceptions. javax.mail.MessagingException: Can't send command to SMTP host; nested exception is: java.net.SocketException: Connection closed by remote host at com.sun.mail.smtp.SMTPTransport.sendCommand(SMTPTransport.java:1564) at com.sun.mail.smtp.SMTPTransport.sendCommand(SMTPTransport.java:1551) at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:1489) at com

Sending 120 mails by Javamail using Gmail account, but got exception after 80/90 mails

与世无争的帅哥 提交于 2020-01-05 12:09:11
问题 Got the below exception while send mails in a loop of 120. First 80/85 mails are success but the remaining got exceptions. javax.mail.MessagingException: Can't send command to SMTP host; nested exception is: java.net.SocketException: Connection closed by remote host at com.sun.mail.smtp.SMTPTransport.sendCommand(SMTPTransport.java:1564) at com.sun.mail.smtp.SMTPTransport.sendCommand(SMTPTransport.java:1551) at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:1489) at com