javamail

Pass hashed password to Java Mail API

送分小仙女□ 提交于 2019-12-23 17:23:28
问题 Good morning everybody, I'm developping an ERP for my company with the GWT Framework and I would get the number of unread emails using the Java Mail API. I can do this but, the problem is I stores the SHA-512 hashed password on the database and I would not pass the clear password to the Java Mail API, but just the hashed password to avoiding to transmit the clear password on the network. I use this code to get the number of unread mail: private static int getNumberOfUnreadMails() { int

Java Mail: Unable to send email via Yahoo

别等时光非礼了梦想. 提交于 2019-12-23 12:27:39
问题 Please have a look at the following code. package email; import java.awt.*; import java.awt.event.*; import javax.mail.*; import javax.mail.internet.*; import java.util.Properties; public class SendEmail { private String to, from, bcc, cc, account, message, password, subject; public SendEmail(String to, String from,String bcc, String cc, String account, String message, String password, String subject) { setFrom(from); setTo(to); setBCC(bcc); setCC(cc); setAccount(account); setMessage(message)

java.lang.NoSuchMethodError: com.sun.mail.util.TraceInputStream

南楼画角 提交于 2019-12-23 09:41:08
问题 I'm trying to send an email through Java Mail API and it works fine on my laptop. When I'm doing exactly the same in Heroku, I'm getting this: java.lang.NoSuchMethodError: com.sun.mail.util.TraceInputStream.(Ljava/io/InputStream;Lcom/sun/mail/util/MailLogger;)V at com.sun.mail.smtp.SMTPTransport.initStreams(SMTPTransport.java:2014) at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1936) at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:654) at javax.mail

java mail store type “imap” vs “imaps”

僤鯓⒐⒋嵵緔 提交于 2019-12-23 07:46:33
问题 I am using the following code to validate an email programatically. Properties properties = new Properties(); Session emailSession = Session.getDefaultInstance(properties); Store store = emailSession.getStore("imap"); store.connect(host, user, password); if(store.isConnected()){ System.out.println("true"); } currently it throws an exception javax.mail.MessagingException: Connection dropped by server?; nested exception is: java.io.IOException: Connection dropped by server? at com.sun.mail.imap

JavaMail not sending Subject or From under jetty:run-war

自古美人都是妖i 提交于 2019-12-23 07:27:37
问题 Has anyone seen JavaMail not sending proper MimeMessages to an SMTP server, depending on how the JVM in started? At the end of the day, I can't send JavaMail SMTP messages with Subject: or From: fields, and it appears other headers are missing, only when running the app as a war. The web project is built with Maven and I'm testing sending JavaMail using a browser and a simple mail.jsp to debug and see different behavior when launching the app with: 1) mvn jetty:run (mail sends fine, with

HTML format using Java mail in android

断了今生、忘了曾经 提交于 2019-12-23 06:14:59
问题 I am trying to implement an HTML format mail using the Java mail in android. I would like to get results like this: When I look at the html format sent from lookout in my GMAIL. I don't see any link, but just has this format: [image: Lookout_logo] [image: Signal_flare_icon] Your battery level is really low, so we located your device with Signal Flare. I was trying the following: Properties props = System.getProperties(); props.put("mail.smtp.starttls.enable", "true"); // added this line props

Websphere 7 javax.mail.MessagingException: SSLSocketFactory is null

允我心安 提交于 2019-12-23 05:45:09
问题 I am trying to connect to mail server using SSL, running on Websphere 7. I have no problem running the code as a standalone test main method, everything goes fine. I have also no problem running the code on Websphere - connecting to mail server (example imap.seznam.cz), but when I do not use SSL. In case I want to use SSL, exception is thrown like this: javax.mail.MessagingException: SSLSocketFactory is null. This can occur if javax.net.ssl.SSLSocketFactory.getDefault() is called to create a

How do you send mail in Android using JavaMail API?

徘徊边缘 提交于 2019-12-23 05:22:13
问题 How do you send mail from Android? The same code is working fine in a Java project but not in Android. 1) GmailSender.java import javax.activation.DataHandler; import javax.activation.DataSource; import javax.mail.Message; import javax.mail.PasswordAuthentication; import javax.mail.Session; import javax.mail.Transport; import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeMessage; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream;

Mail forwarding with javamail

耗尽温柔 提交于 2019-12-23 04:49:12
问题 Following this thread, I am trying to implement mail forwarding to gmail with javamail, however I don't manage to make the email to contain original from and to and cc lines. Whatever I do, the email appear as it was sent by the user authenticated by the session. To simplify the request: how to redefine FROM, TO, CC and BCC lines of the email sent to gmail without really sending an email to this addresses. Something like that: @Test public void test3() throws Exception { SMTPMessage msg = new

Sending mail to multiple recipient

匆匆过客 提交于 2019-12-23 04:37:15
问题 I have a simple interface that looks like below: It's pretty self-explanatory and I can enter my recipient email and it will pass the value to a function. My javascript function(when send button invoked): <script> //function to insert content of email to table function sendmessage(){ var recipient = document.getElementById("recipient").value; var subject = document.getElementById("subject").value; var content=document.getElementById("content").value; $.ajax({ url: 'sendemail.jsp', type: 'POST