[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Classpathx-javamail] sending emails with authentication
From: |
Daniel Rindt |
Subject: |
Re: [Classpathx-javamail] sending emails with authentication |
Date: |
Sun, 19 Sep 2010 04:33:25 +0200 |
Am Donnerstag, den 16.09.2010, 08:27 +0100 schrieb Chris Burdess:
> The PrintStream(File) constructor specifically says that it won't
> flush the underlying stream. You will need to call flush manually on
> that PrintStream, or use the OutputStream constructor.
Yes. But this is also not working:
=== 8< ===
Session session = Session.getInstance(props, auth);
session.setDebug(true);
PrintStream ps = null;
try {
ps = new PrintStream("/tmp/classpathx-mail.out");
session.setDebugOut(ps);
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
Message msg = new MimeMessage(session);
msg.setFrom(new InternetAddress(senderAddress));
msg.setRecipients(Message.RecipientType.TO, InternetAddress.parse(
recipientsAddress, false));
msg.setSubject(subject);
msg.setText(text);
msg.saveChanges();
Transport.send(msg);
} catch (Exception e) {
e.printStackTrace();
}
ps.flush();
ps.close();
=== 8< ===
I got nothing in the file, its just zero bytes. Thanks for further help.
TIA
Daniel
- [Classpathx-javamail] sending emails with authentication, Daniel Rindt, 2010/09/14
- Re: [Classpathx-javamail] sending emails with authentication, Chris Burdess, 2010/09/14
- Message not available
- Re: [Classpathx-javamail] sending emails with authentication, Chris Burdess, 2010/09/14
- Re: [Classpathx-javamail] sending emails with authentication, Daniel Rindt, 2010/09/15
- Re: [Classpathx-javamail] sending emails with authentication, Chris Burdess, 2010/09/16
- Re: [Classpathx-javamail] sending emails with authentication,
Daniel Rindt <=
- Re: [Classpathx-javamail] sending emails with authentication, Chris Burdess, 2010/09/20
- Re: [Classpathx-javamail] sending emails with authentication, Daniel Rindt, 2010/09/20
- Re: [Classpathx-javamail] sending emails with authentication, Chris Burdess, 2010/09/21
- Re: [Classpathx-javamail] sending emails with authentication, Daniel Rindt, 2010/09/21
- Message not available
- Message not available
- Message not available
- Re: [Classpathx-javamail] sending emails with authentication, Chris Burdess, 2010/09/27
- Re: [Classpathx-javamail] sending emails with authentication, Daniel Rindt, 2010/09/27