I am trying to send an email with attachment. The code below sends the file
in-line. How to send as attachment?

client.setSender(this.senderEmail);
client.addRecipient(this.recepientEmailAddress);
header = new SimpleSMTPHeader(this.senderEmail, this.recepientEmailAddress,
this.emailSubject);

fileReader = new FileReader(fileName);
writer = client.sendMessageData();

if (writer != null)
{
 writer.write(header.toString());
 Util.copyReader(fileReader, writer);
 writer.close();
 client.completePendingCommand();
}



Cheers,
Ashish Naik




*********************************************************
Disclaimer:          

This message (including any attachments) contains 
confidential information intended for a specific 
individual and purpose, and is protected by law. 
If you are not the intended recipient, you should 
delete this message and are hereby notified that 
any disclosure, copying, or distribution of this
message, or the taking of any action based on it, 
is strictly prohibited.

*********************************************************
Visit us at http://www.mahindrabt.com

Reply via email to