• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Blank Email Notification

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

In our application we are sending out a Email Notification to the customer using java.

Most of the customer are getting the notification properly. Few of the users are complaining that tehey are receiving the Email with blank body, but the mail has the proper subject.

What could be the cause of this.

Thanks in advance for your suggestion on the above issue.
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Krish Vasu:

What could be the cause of this.



The exact cause depends on how you're sending the mail, of course: JavaMail, a shell script, hand-written SMTP client code, etc. You'll have to give us a few details before we can help you.
 
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you are sending HTML / RTF mails, it will definitly confuse older versions of some email clients ( e.g PINE 4.21, not 100% sure though).
It just downloads the body as an attachment named "Unknown" or "email.dat".

Another common problem behind "Empty Body" for Text based email clients is not understanding the charset.
 
Krish Vasu
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Thanks for the update.

We are sending the email content in the text format by writing to a Socket.

What should be ideal charset the client needs to configure in their email client.

I have been informed by the user that they are using Lotus Notes as their emial client.

Pls, advice. Thanks...
 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Krish Vasu:
Hi,

Thanks for the update.

We are sending the email content in the text format by writing to a Socket.

What should be ideal charset the client needs to configure in their email client.

I have been informed by the user that they are using Lotus Notes as their emial client.

Pls, advice. Thanks...



Bad idea!!!

Socket connections, although appear to work in a standard way, are notorious when it comes to SMTP server side implementation. For example, not long ago we had a situation, where if the application was sending email via Sendmail server, by doing socket communication on port 25, the body of the email disappeared, but the same code when it ran against Domino mail server ran fine!!!

turned out, that the exact format that u need to send the SMTP commands varies with the SMTP implementation:

for sendmail it is
helo
mail from:
rctp to:

data

subject:

<actual body>

.

With domino, it was
helo
mail from:
rctp to:


data


subject:


<actual body>
.

The number of CR-LF that you put between SMTP commands is different!!!

I would suggest that you resort to using Java mail api as it will take care of all the various permutation/combinations that exist for various SMTP implementations, not to mention it keeps the code clean
 
Ernest Friedman-Hill
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Vikas, this explanation about the number of line feeds is bogus; such a server couldn't function on the heterogeneous Internet. Much more likely, the problem you saw was caused by a failure to flush the data (using "flush()") you were sending to the socket at the appropriate times. The extra newlines may have triggered automatic flushing at just the right moments.

So Krish, be sure to flush the commands and data you send, and be sure the read the replies from the server and do something with them: ideally, parse out the result codes and report or respond to errors.

Rather than using a socket, you might consider using the JavaMail API, which would do all of this for you.
 
He's giving us the slip! Quick! Grab this tiny ad!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic