Re: email sent from java app haults queues
- From: Nigel Wade <nmw@xxxxxxxxxxxx>
- Date: Fri, 24 Mar 2006 11:08:37 +0000
dylan.roehrig@xxxxxxxxx wrote:
Looking at the exchange logs, the last thing that the exchange server
says is
2006-03-22 20:42:11 4.79.181.18 OutboundConnectionResponse SMTPSVC1
mailserver - 25 - - 354+go+ahead 0 0 12 0 437 SMTP - - - -
I don't do Exchange, so I don't know what all that means. It's not exactly
transparent in meaning is it? Is that the server accepting the message from the
client, or the server attempting to forward it on?
If it's the Exchange server forwarding the message, and the 437 is a reply code
from the external MTA then that indicates a transient error. A 4xx reply code
indicates that was the message was ok, but the receiving MTA was unable to
process the message at the current time - please call again later. Always
supposing that Microsoft obey the accepted protocols...
Does JavaMail put a <CRLF>.<CRLF> automatically at the end of the
message?
It does everything required to compose a correct message. If it didn't the
Exchange server should not have accepted it.
Here is a snippet of code I use to send new users a "welcome" message (which
automatically generates their mail account) when I register them:
Properties props = System.getProperties();
// Setup mail server
props.put("mail.smtp.host", ConfigurationData.getMailServer());
// Get session
Session session = Session.getDefaultInstance(props, null);
// Define message
MimeMessage message = new MimeMessage(session);
message.setFrom(new InternetAddress("xxx@yyy"));
message.addRecipient(Message.RecipientType.TO, new
InternetAddress(recipient));
message.setSubject("Welcome to the Space Plasma Physics mail system");
message.setText("This is a test message to ensure that email is working.");
// Send message
Transport.send(message);
As you can see, there's not a lot to it. There certainly is no need to terminate
the message with a <CR><LF>.<CR><LF>. That is part of the transmission protocol
and is handled by Transport.send() for SMTP.
--
Nigel Wade, System Administrator, Space Plasma Physics Group,
University of Leicester, Leicester, LE1 7RH, UK
E-mail : nmw@xxxxxxxxxxxx
Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555
.
- Follow-Ups:
- Re: email sent from java app haults queues
- From: dylan . roehrig
- Re: email sent from java app haults queues
- References:
- email sent from java app haults queues
- From: dylan . roehrig
- Re: email sent from java app haults queues
- From: Nigel Wade
- Re: email sent from java app haults queues
- From: dylan . roehrig
- Re: email sent from java app haults queues
- From: Nigel Wade
- Re: email sent from java app haults queues
- From: dylan . roehrig
- email sent from java app haults queues
- Prev by Date: Re: Covariance of Java primitives
- Next by Date: Re: How to find the available free space in a system using java
- Previous by thread: Re: email sent from java app haults queues
- Next by thread: Re: email sent from java app haults queues
- Index(es):
Relevant Pages
|