Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Attachment at specific Place

 
Andy Smith
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using Java MaIl APi's to send the mail...
i have mail as descibed in the format below. I am able to send the mail with attachemnts.... I need to place the attachment at the specific place in the mail body as in the example below... Is this possible?

*********************************************
This is the first line of the dummy text
This is the SEcond line of the dummy text

attachment here

This is the SEcond last line of the dummy text
This is the Last line of the dummy text


******************************************
 
Joel McNary
Bartender
Posts: 1840
Eclipse IDE Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think so. Do mail readers support attachments within the message? (None of mine do...attachements are kept separate from the body.) Conceptually, the Body of a message is different from the attachements. Attachments are essentially appendices to the body. What I would do in this case is say:

*********************************************
This is the first line of the dummy text
This is the SEcond line of the dummy text

Please refer to Attachement 1

This is the SEcond last line of the dummy text
This is the Last line of the dummy text

*********************************************

And then attach the attachements normally.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A message is just a composition of Parts and an attachement is just a Part with a different content type. A Part has a property of INLINE which you can set to tell Mail User Agents to render it inline with the rest of the message, rather than the usual way of handling it. However, there is nothing in SMTP's RFC to require attachements to be presented inline - presentation is always delegated to the MUA. So you can't guarentee how the mail is presented. That is, unless you send the mail as HTML.
 
Andy Smith
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanx a lot , that seems to be gud

my attachment can be a txt file or doc.. file
If i set the part to INLINE will this show the contents at the specific place or the link to the attchmanent?
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

If i set the part to INLINE will this show the contents at the specific place or the link to the attchmanent?

As I said above, it depends on the Mail User Agent (Outlook, Pegasus etc.) because there is nothing in SMTP's RFC to require attachements to be inlined. Sending a message as HTML might be a better idea if this is what you need (of course not all MUA's will support HTML messages, so again its not a guarentee).
 
Andy Smith
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanx Joel McNary, Paul Sturrock
 
My, my, aren't you a big fella. Here, have a tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!