简体   繁体   English

从 Java 中的 contentBytes 创建 Aspose.Email 附件

[英]Create Aspose.Email attachment from contentBytes in Java

I know that we can create an aspose email attachment using the below code:我知道我们可以使用以下代码创建一个 aspose 电子邮件附件:

//Create an instance of Attachment class
Attachment attachment;

//Load an attachment
attachment = new Attachment("1.txt");

My question is if I don't have the attachment path or URL but only the name of the file and the content body bytes, how to create the attachment in this case?我的问题是,如果我没有附件路径或 URL,而只有文件名和内容正文字节,在这种情况下如何创建附件?

You can pass file name and stream of your file content in Attachment class.您可以在Attachment类中传递文件名和文件内容流。 For more detail, please read following article.更多详情,请阅读以下文章。

Working with Message Attachments 使用邮件附件

I work with Aspose as Developer Evangelist.我与 Aspose 一起担任开发人员宣传员。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM