diff --git a/README-EN.md b/README-EN.md
new file mode 100644
index 0000000000000000000000000000000000000000..ee36634593af7d1d4ec44992be912b442f604d2d
--- /dev/null
+++ b/README-EN.md
@@ -0,0 +1,926 @@
+# mail
+
+English | [简体中文](./README.md)
+
+## Brief Introduction
+
+> Parse and build e-mail in eml format, detect the MIME type of files, send and receive mail, and manage them.
+
+![log.gif](image/sample.gif)
+
+## Installation
+
+```shell
+npm install @ohos/mail --save
+```
+
+OpenHarmony
+For more information about npm environment configuration, please refer to [Installing the OpenHarmony npm Package](https://gitee.com/openharmony-tpc/docs/blob/master/OpenHarmony_npm_usage-en.md) 。
+
+## Precautions for using test resources
+
+The built-in test resource file is placed in Under the ./testFile directory, you can upload it through git lfs. If you download the zip package of the project directly, the resource file you get is only a shortcut. You need to download it manually in the resource file directory. Or download the code through git clone, so that the resource file obtained is complete.
+
+## Instruction for use
+
+1、Import Dependencies
+
+ ```
+ import { MimeTypeDetector,EmlFormat,Store,Attachment } from '@ohos/mail';
+ ```
+
+2、Add permissions in module.json5
+ ```
+ "requestPermissions": [
+ {
+ "name": "ohos.permission.INTERNET"
+ },
+ {
+ "name": "ohos.permission.GET_NETWORK_INFO"
+ },
+ {
+ "name": "ohos.permission.GET_WIFI_INFO"
+ }
+ ]
+ ```
+
+3、Initialize MimeTypeDetector in MainAbility
+
+ ```
+ onWindowStageCreate(windowStage) {
+ MimeTypeDetector.init((data)=>{
+ globalThis.cacheContent=data
+ })
+ }
+ ```
+
+4、File Mime type resolution
+
+ ```
+ //Parse the MimeType of the file
+ let mimetype =MimeTypeDetector.detectMimeType(path + "/logdemo.bat")
+ console.log('sample mimetype detectMimeType bat:' + mimetype);
+ ```
+
+5、Message resolution
+
+ ```
+ //Parse mail file
+ let filePath = path + '/sample.eml'
+ new EmlFormat().parse(filePath, function (error, result) {
+ console.info('result-------' + JSON.stringify(result))
+ });
+
+ //Parse the message content of string type
+ let content="'
+ EmlFormat.parseString(content, (error, msg: Message) => {
+ //Get various details of mail
+ MailLogger.info('ohos_test-- text--' + JSON.stringify(result.getFrom()[0]))
+ MailLogger.info('ohos_test-- text--' + JSON.stringify(result.getSubject()))
+ MailLogger.info('ohos_test-- text--' + JSON.stringify(result.getRecipients(RecipientType.TO)))
+ MailLogger.info('ohos_test-- text--' + JSON.stringify(result.getText()))
+ MailLogger.info('ohos_test-- html--' + JSON.stringify(result.getHtml()))
+ MailLogger.info('ohos_test-- file--' + JSON.stringify(result.getFiles()))
+ ...
+ });
+ ```
+
+6、Build Mail
+
+ ```
+ private from: string = "154783421@qq.com";
+ private to: string[] = ["liangtaorun@sina.com", "liang_tao001@hoperun.com"];
+ private Cc: string[] = ["2799502794@qq.com"];
+ private Bc: string[] = ["2799502794@qq.com"];
+
+ let mimeMessage = new MimeMessage()
+ mimeMessage.setFrom(this.from)
+ mimeMessage.setRecipients(RecipientType.TO, this.to)
+ mimeMessage.setRecipients(RecipientType.CC, this.Cc)
+ mimeMessage.setRecipients(RecipientType.BCC, this.Bc)
+ mimeMessage.setSubject("")
+ mimeMessage.setMIMEVersion("1.0")
+
+ let path:string="/data/app/el2/100/base/cn.openharmony.mail/haps/entry/files"
+ //Format the body as plain text
+ mimeMessage.setText("test")
+ //Set html format file
+ // mimeMessage.setHtml("" + "
" + text + "
")
+ //Set html format file with pictures
+ let contentId = "imag01"
+ mimeMessage.addImgInside(new MimeBodyPart(path, "test.png", contentId))
+ let contentId1 = "imag02"
+ mimeMessage.addImgInside(new MimeBodyPart(path, "test.png", contentId1))
+ mimeMessage.setHtml(""
+ + "" + this.text
+ + "
"
+ + "
"
+ + "
")
+
+ //Set attachments
+ mimeMessage.addAttachmentBody(new AttachmentBody(path, "test.png"))
+ mimeMessage.addAttachmentBody(new AttachmentBody(path, "test.png"))
+ let buildResult:string = mimeMessage.getMimeMessage()
+ ```
+
+7、Set the protocol for reading mailboxes (IMAP and POP3 protocols are supported)
+
+ ```
+ //Set imap protocol
+ var properties = new Properties("imap")
+ //Set imap server address
+ properties.setHost("imap.qq.com")
+ //Set imap server port
+ properties.setPort(143)
+
+ //Set pop3 protocol
+ var properties = new Properties("pop3")
+ //Set pop3 server address
+ properties.setHost("pop.qq.com")
+ //Set the pop3 server port
+ properties.setPort(110)
+ ```
+
+8、Send mail
+
+ ```
+ private from: string = "154783421@qq.com";
+ private to: string[] = ["liangtaorun@sina.com", "liang_tao001@hoperun.com"];
+ private Cc: string[] = ["2799502794@qq.com"];
+ private Bc: string[] = ["2799502794@qq.com"];
+
+ var properties = new Properties()
+ properties.setFrom(this.from)
+ properties.setHost(this.host)
+ properties.setPort(this.port)
+ properties.setAuthorizationCode(this.authorizationCode)
+ this.transport = new TransPort()
+ //Connection service
+ this.transport.connect(properties, (success, err) =>{
+ if (success) {
+ MailLogger.info('ohos_mail-- login smtp success:')
+ let mimeMessage = new MimeMessage()
+ mimeMessage.setFrom(this.from)
+ mimeMessage.setRecipients(RecipientType.TO, this.to)
+ mimeMessage.setRecipients(RecipientType.CC, this.Cc)
+ mimeMessage.setRecipients(RecipientType.BCC, this.Bc)
+ mimeMessage.setSubject("")
+ mimeMessage.setMIMEVersion("1.0")
+
+ let path:string="/data/app/el2/100/base/cn.openharmony.mail/haps/entry/files"
+ //Format the body as plain text
+ mimeMessage.setText("")
+ //Set html format file
+ // mimeMessage.setHtml("" + "" + text + "
")
+ //Set html format file with pictures
+ let contentId = "imag01"
+ mimeMessage.addImgInside(new MimeBodyPart(globalThis.filesPath, "test.png", contentId))
+ let contentId1 = "imag02"
+ mimeMessage.addImgInside(new MimeBodyPart(globalThis.filesPath, "test.png", contentId1))
+ mimeMessage.setHtml(""
+ + "" + this.text
+ + "
"
+ + "
"
+ + "
")
+
+ //Set attachments
+ mimeMessage.addAttachmentBody(new AttachmentBody(path, "test.txt"))
+ mimeMessage.addAttachmentBody(new AttachmentBody(path, "test.docx"))
+ //Send mail
+ this.transport.sendMessage(mimeMessage, (success, err) =>{
+ if (success) {
+ MailLogger.info('ohos_mail-- send mail success!');
+ prompt.showToast({message:"发送成功!", duration:4000})
+ } else {
+ prompt.showToast({message:"发送失败:" + JSON.stringify(err), duration:4000})
+ }
+ //Close connection
+ this.transport.close()
+ })
+
+ } else {
+ prompt.showToast({message:err, duration:4000})
+ MailLogger.error('ohos_mail-- login smtp fail:' + err);
+ }
+ });
+ ```
+
+9、Receive mail (support pop3 and imap protocols)
+
+ ```
+ var properties = new Properties("imap")
+ properties.setHost("imap.qq.com")
+ properties.setPort(143)
+ properties.setFrom(this.from)
+ properties.setAuthorizationCode("")
+ var store = new Store(properties)
+ store.connect(async (success, err) => {
+ if (success) {
+ //Get INBOX mailbox object (inbox)
+ let folder: Folder = store.getFolder("INBOX")
+ //Open INBOX mailbox
+ folder.open(Folder.READ_WRITE, async () => {
+ //Get all messages of the current mailbox
+ let messages = folder.getMessages()
+ //Get the first message (the earliest)
+ let msg = messages[0]
+ await new Promise((resolve, reject) => {
+ //Get the parsed message content
+ msg.getContent((success, result: Message) => {
+ MailLogger.info('ohos_test-- text--' + JSON.stringify(result.getFrom()[0]))
+ MailLogger.info('ohos_test-- text--' + JSON.stringify(result.getSubject()))
+ MailLogger.info('ohos_test-- text--' + JSON.stringify(result.getRecipients(RecipientType.TO)))
+ MailLogger.info('ohos_test-- text--' + JSON.stringify(result.getText()))
+ MailLogger.info('ohos_test-- html--' + JSON.stringify(result.getHtml()))
+ MailLogger.info('ohos_test-- file--' + JSON.stringify(result.getFiles()))
+ resolve('');
+ })
+ })
+ .then((result) => {
+ return new Promise((resolve, reject) => {
+ //Get the original content of the message (unresolved)
+ msg.getOriginalContent((success, result: string) => {
+ MailLogger.info('ohos_test-- file--' + string)
+ resolve('');
+ })
+ })
+ })
+ .then((result) => {
+ return new Promise((resolve, reject) => {
+ //Get all flags of the message
+ msg.getFlags((success, result) => {
+ MailLogger.info('ohos_test-- flags--' + JSON.stringify(result))
+ resolve('');
+ })
+ })
+ })
+ .then((result) => {
+ return new Promise((resolve, reject) => {
+ //Get all headers of the message
+ msg.getAllHeaders((success, result) => {
+ MailLogger.info('ohos_test-- all Header--' + JSON.stringify(result.result))
+ MailLogger.info('ohos_test-- subject--' + result.getSubject())
+ MailLogger.info('ohos_test-- from--' + result.getFrom()[0])
+ MailLogger.info('ohos_test-- To--' + JSON.stringify(result.getRecipients(RecipientType.TO)))
+ MailLogger.info('ohos_test-- Cc--' + JSON.stringify(result.getRecipients(RecipientType.CC)))
+ MailLogger.info('ohos_test-- ReplyTo--' + result.getReplyTo())
+ MailLogger.info('ohos_test-- date--' + result.getSentDate())
+ resolve('');
+ })
+ })
+ })
+ .then((result) => {
+ return new Promise((resolve, reject) => {
+ //Get message size (KB)
+ msg.getSize((success, result) => {
+ MailLogger.info('ohos_test-- size--' + JSON.stringify(result))
+ resolve('');
+ })
+ })
+ })
+ .then((result) => {
+ return new Promise((resolve, reject) => {
+ //Header value of fireball mail object by header name
+ msg.getHeader('To', (success, result) => {
+ MailLogger.info('ohos_test-- getHeader--' + JSON.stringify(result))
+ resolve('');
+ })
+ })
+ })
+ .then((result) => {
+ return new Promise((resolve, reject) => {
+ //Get the UID of the message
+ folder.getUID(msg, (success, data) => {
+ MailLogger.info('ohos_test-- UID--' + JSON.stringify(data))
+ //Get mail through UID
+ let message = folder.getMessageByUID(data)
+ MailLogger.info('ohos_test-- getMessageByUID--' + JSON.stringify(message.getText()))
+ resolve('');
+ })
+ })
+ })
+ .then((result) => {
+ return new Promise((resolve, reject) => {
+ //Close server link
+ store.close()
+ resolve('');
+ })
+ })
+ })
+ ```
+
+10、Delete mail
+
+ ```
+ var properties = new Properties("imap")
+ properties.setHost("imap.qq.com")
+ properties.setPort(143)
+ properties.setFrom("xxx@qq.com")
+ properties.setAuthorizationCode("sdfasdfdf")
+ var store = new Store(properties)
+ store.connect(async (success, err) => {
+ if (success) {
+ let folder: Folder = store.getFolder("INBOX")
+ folder.open(Folder.READ_WRITE, () => {
+ let msgs = folder.getMessages()
+ msgs[this.deleteMsgIndex-1].setFlag(Flag.DELETED, (success, result) => {
+ if (success) {
+ if(this.protocol=="pop3"){ //Pop3 calls the quit method
+ store.quit()
+ }else{ //Imap calls the expunge method
+ folder.expunge()
+ }
+ }
+ })
+ })
+ } else {
+ prompt.showToast({ message: err, duration: 4000 })
+ MailLogger.info('ohos_mail-- login IMAP fail : ' + err)
+ }
+ })
+ ```
+
+11、Move mail
+
+ ```
+ var properties = new Properties("imap")
+ properties.setHost("imap.qq.com")
+ properties.setPort(143)
+ properties.setFrom(this.from)
+ properties.setAuthorizationCode("")
+ var store = new Store(properties)
+ store.connect(async (success, err) => {
+ if (success) {
+ //Get INBOX mailbox object
+ let folder: Folder = store.getFolder("INBOX")
+ //Open INBOX mailbox
+ folder.open(Folder.READ_WRITE, async () => {
+ //Get all messages of the current mailbox
+ let messages = folder.getMessages()
+ //Get the first message (the earliest)
+ folder.moveMessages([messages[0]], new Folder('Sent Messages'),(success,err)=>{
+ if(success){
+ MailLogger.info('ohos_mail-- moveMessages success')
+ }else{
+ MailLogger.info('ohos_mail-- moveMessages fail : ' + err)
+ }
+ })
+ })
+ ```
+
+12、Forward/reply to mail
+
+ ```
+ private from: string = "154783421@qq.com";
+ private to: string[] = ["liangtaorun@sina.com", "liang_tao001@hoperun.com"];
+ private Cc: string[] = ["2799502794@qq.com"];
+ private Bc: string[] = ["2799502794@qq.com"];
+
+ var properties = new Properties("imap")
+ properties.setHost("imap.qq.com")
+ properties.setPort("143")
+ properties.setFrom(this.from)
+ properties.setAuthorizationCode("asdasd")
+ var store = new Store(properties)
+ store.connect((success, err) => {
+ if (success) {
+ let folder: Folder = store.getFolder("INBOX")
+ folder.open(Folder.READ_WRITE, async () => {
+ let messages = folder.getMessages()
+ messages[0].getContent((success, message: Message) => {
+ var properties = new Properties()
+ properties.setFrom(this.from)
+ properties.setHost("smpt.qq.com")
+ properties.setPort(25)
+ properties.setAuthorizationCode("asdasd")
+ this.transport = new TransPort()
+ //Connection service
+ this.transport.connect(properties, (success, err) => {
+ if (success) {
+ MailLogger.info('ohos_mail-- login smtp success:');
+ let mimeMessage = new MimeMessage()
+ mimeMessage.setFrom(this.from)
+ mimeMessage.setRecipients(RecipientType.TO, this.to)
+ mimeMessage.setRecipients(RecipientType.CC, this.Cc)
+ mimeMessage.setRecipients(RecipientType.BCC, this.Bc)
+ mimeMessage.setSubject("转发:" + message.getSubject())
+
+ let text = "转发测试\r\n\r\n\r\n"
+ + "------------------ 原始邮件 ------------------\r\n"
+ + "发件人: " + message.getFrom()[0] + "\r\n"
+ + "发送时间: " + message.getSentDate() + "\r\n"
+ let to = message.getRecipients(RecipientType.TO)
+ if (!!to) {
+ text += "收件人: "
+ for (let i = 0; i < to.length; i++) {
+ if (i != to.length - 1) {
+ text += to[i] + " , "
+ } else {
+ text += to[i] + "\r\n"
+ }
+ }
+ }
+
+ text += "主题: " + message.getSubject() + "\r\n"
+ let cc = message.getRecipients(RecipientType.CC)
+ if (!!cc) {
+ text += "抄送: "
+ for (let i = 0; i < cc.length; i++) {
+ if (i != cc.length - 1) {
+ text += cc[i] + " , "
+ } else {
+ text += cc[i] + "\r\n"
+ }
+ }
+ }
+ +"\r\n\r\n"
+ + message.getText()
+ //Format the body as plain text
+ mimeMessage.setText(text)
+ //Set html
+ mimeMessage.setHtml(message.getHtml())
+ let files = message.getFiles()
+ let path:string="/data/app/el2/100/base/cn.openharmony.mail/haps/entry/files"
+ if (!!files) {
+ for (let i = 0;i < files.length; i++) {
+ let file = files[i]
+ if (!!file.getContentID()) {
+ var mimeBody = new MimeBodyPart(path, file.getFileName(), file.getContentID())
+ mimeBody.setDta(file.getData())
+ mimeBody.setMimeType(file.getMimeType())
+ mimeMessage.addImgInside(mimeBody)
+ } else {
+ mimeMessage.addAttachmentBody(file)
+ }
+ }
+ }
+ //Forward mail
+ this.transport.sendMessage(mimeMessage, (success, err) => {
+ if (success) {
+ MailLogger.info('ohos_mail-- send message success');
+ prompt.showToast({ message: "转发成功!", duration: 4000 })
+ } else {
+ prompt.showToast({ message: "转发失败:" + JSON.stringify(err), duration: 4000 })
+ }
+
+ store.close()
+ })
+ } else {
+ prompt.showToast({ message: err, duration: 4000 })
+ MailLogger.info('ohos_mail-- login smtp fail:' + err);
+ }
+ });
+ })
+ })
+ } else {
+ prompt.showToast({ message: err, duration: 4000 })
+ MailLogger.info('ohos_mail-- login IMAP fail : ' + err);
+ }
+ })
+ ```
+
+13、Mailbox Management
+
+ ```
+ var properties = new Properties("imap")
+ properties.setHost("imap.qq.com")
+ properties.setPort(25)
+ properties.setFrom(this.from)
+ properties.setAuthorizationCode("")
+ var store = new Store(properties)
+ store.connect(async (success, err) => {
+ if (success) {
+ //Create mailbox (folder)
+ store.createFolder("Test", (success, err) =>{
+ if (success) {
+ console.info('ohos_mail-- create mail success')
+ } else {
+ console.info('ohos_mail-- create mail fail:' + err)
+ }
+ })
+
+ //Rename mailbox (folder)
+ store.renameFolder("Test", "TestMail", (success, err) =>{
+ if (success) {
+ console.info('ohos_mail-- rename mail success')
+ } else {
+ console.info('ohos_mail-- rename mail fail:' + err)
+ }
+ })
+
+ //Delete mailbox (folder)
+ store.deleteFolder("TestMail", (success, err) =>{
+ if (success) {
+ console.info('ohos_mail-- delete mail success')
+ } else {
+ console.info('ohos_mail-- delete mail fail:' + err)
+ }
+ })
+
+ //Get INBOX mailbox object
+ let folder: Folder = store.getFolder("INBOX")
+ //Open INBOX mailbox
+ folder.open(Folder.READ_WRITE, async () => {
+ //Get information about the mailbox
+ MailLogger.info('ohos_test-- messageCount--' + folder.getMessageCount())
+ MailLogger.info('ohos_test-- unreadMessageCount--' + folder.getUnreadMessageCount())
+ MailLogger.info('ohos_test-- newMessageCount--' + folder.getNewMessageCount())
+ MailLogger.info('ohos_test-- uidNext--' + folder.getUIDNext())
+ MailLogger.info('ohos_test-- UIDValidity--' + folder.getUIDValidity())
+ MailLogger.info('ohos_test-- mode--' + folder.getMode())
+ MailLogger.info('ohos_test-- name--' + folder.getName())
+ MailLogger.info('ohos_test-- fullname--' + folder.getFullName())
+
+ await new Promise((resolve, reject) => {
+ //Get the number of deleted messages
+ folder.getDeletedMessageCount((success, result) => {
+ MailLogger.info('ohos_test-- deletedMessageCount--' + result)
+ resolve('');
+ })
+ })
+ .then((result) => {
+ return new Promise((resolve, reject) => {
+ //Judge whether the current mailbox exists
+ folder.exists((success, result) => {
+ MailLogger.info('ohos_test-- exists--' + result)
+ resolve('');
+ })
+ })
+ })
+ .then((result) => {
+ return new Promise((resolve, reject) => {
+ //Get mailbox list
+ folder.list((success, result) => {
+ MailLogger.info('ohos_test-- list--' + JSON.stringify(result))
+ resolve('');
+ })
+ })
+ })
+
+ //Get all messages of the current mailbox
+ let messages = folder.getMessages()
+ })
+ }
+ ```
+
+## Interface description
+
+### EmlFormat(Message resolution)
+
+* Resolve file of message type
+
+ `parse(path: string, callback)`
+
+* Parse the message content of string type
+
+ `parseString(eml: string, parseCallBack)`
+
+* Build Mail
+
+ `buildEml(data: Data, callback?)`
+
+### MimeTypeDetector(Detect file Mime type)
+
+* Detect file Mime type
+
+ `detectMimeType(path: string)`
+
+### Properties(Session information for connecting to the mail server)
+
+* Set sender(user name)
+
+ `setFrom(this.from)`
+
+* Set server address
+
+ `setHost(this.host)`
+
+* Set Port
+
+ `setPort(this.port)`
+
+* Set mailbox authorization code
+
+ `setAuthorizationCode(this.authorizationCode)`
+
+### TransPort(Mail sending)
+
+* Connect and log in to the SMTP outgoing server
+
+ `connect(properties: Properties, loginEvent: (success, err?) => void)`
+
+* Send mail
+
+ `sendMessage(mimeMessage: MimeMessage, event: (success, result) => void)`
+
+* Close server connection
+
+ `close()`
+
+* Send an empty message
+
+ `noop()`
+
+* Set server connection timeout
+
+ `setTimeOut(timeout:number)`
+
+### Store(Primary linked server, creating, deleting and renaming mailbox operations)
+
+* Connect and log in to the Imap inbox server
+
+ `connect(connectCallback: (success, err?) => void)`
+
+* Set connection timeout
+
+ `setTimeOut(timeout:number))`
+
+* Close link
+
+ `close()`
+
+* Send an empty message
+
+ `noop() `
+
+* Get mailbox object with more mailbox name
+
+ `getFolder(name: string): Folder`
+
+* Create mailbox(folder)
+
+ `createFolder(name: string, callBack)`
+
+* Delete mailbox(folder)
+
+ `deleteFolder(name: string, callBack)`
+
+* Rename mailbox(folder)
+
+ `renameFolder(oldName: string, newName: string, callBack)`
+
+* End the mail receiving process. After receiving this command, pop3 deletes all messages with deletion marks and closes the network link with the pop3 client program.
+
+ `quit()`
+
+### MimeMessage(Build mail structure)
+
+* Set sender
+
+ `setFrom(from: string)`
+
+* Set recipients
+
+ `setRecipients(addressType: RecipientType, addresses: string[])`
+
+* Append recipients by recipient type
+
+ `addRecipients(addressType: RecipientType, addresses: string[])`
+
+* Set html
+
+ `setHtml(html: string)`
+
+* Add html embedded image
+
+ `addImgInside(imgInside: MimeBodyPart)`
+
+* Set date
+
+ `setSentDate(date: Date)`
+
+* Add attachments
+
+ `addAttachmentBody(attachmentBody: AttachmentBody)`
+
+* Set up themes
+
+ `setSubject("测试邮件发送")`
+
+* Set message body
+
+ `setText("这是一个邮件测试邮件")`
+
+* Set MIMEVersion
+
+ `setMIMEVersion("1.0")`
+
+* Get the built message content
+
+ `getMimeMessage()`
+
+### Message(The result set parsed after reading the message)
+
+* Get Folder
+
+ `getFolder(): Folder`
+
+* Set Message Flag
+
+ `setFlag(flag: Flag, callback)`
+
+* Get send date
+
+ `getSentDate(): string`
+
+* Get the number of message lines
+
+ `getLineCount():number`
+
+* Get message size
+
+ `getSize(callback)`
+
+* Get the full content of the message(parsed)
+
+ `getContent(callback)`
+
+* Get the original content of the message(unresolved)
+
+ `getOriginalContent(callback)`
+
+* Get message label
+
+ `getMessageNumber(): number`
+
+* Get message subject
+
+ `getSubject(): string`
+
+* Get sender
+
+ `getFrom(): string[]`
+
+* Get ReplyTo
+
+ `getReplyTo(): string[]`
+
+* Get recipients
+
+ `getRecipients(addressType: RecipientType): string[]`
+
+* Get all recipients
+
+ `getAllRecipients(): string[]`
+
+* Get message text content
+
+ `getText()`
+
+* Get attachment list
+
+ `getFiles()`
+
+* Get html
+
+ `getHtml()`
+
+* Get MIMEVersion
+
+ `getMIMEVersion(callback)`
+
+* Get Header
+
+ `getHeader(headerName: string, callback)`
+
+* Get all headers
+
+ `getAllHeaders(callback)`
+
+### Folder(Mailbox tool class)
+
+* Get Store
+
+ `getStore(): Store`
+
+* Get mailbox list
+
+ `list(callback)`
+
+* Open Folder
+
+ `open(mode: number, callback)`
+
+* Close connection
+
+ `close()`
+
+* Get whether the current folder is open
+
+ `isOpen(): boolean`
+
+* Get mail object by number
+
+ `getMessage(msgNums: number)`
+
+* Move message
+
+ `moveMessages(srcMsg: Message[], folder: Folder, callback)`
+
+* Determine whether the folder exists
+
+ `exists(callback)`
+
+* Delete messages marked with delete
+
+ `expunge(): Message[]`
+
+* Get the number of all messages
+
+ `getMessageCount(): number`
+
+* Get the number of unread messages
+
+ `getUnreadMessageCount(): number`
+
+* Get the number of latest messages
+
+ `getNewMessageCount(): number`
+
+* Get the number of deleted messages
+
+ `getDeletedMessageCount(callback)`
+
+* Get Open Mode
+
+ `getMode(): number`
+
+* Get folder name
+
+ `getName(): string`
+
+* Get the UID of the next new message
+
+ `getUIDNext(): number`
+
+* Get UIDValidity
+
+ `getUIDValidity(): number`
+
+* Get Get All Messages
+
+ `getMessages(): Message[]`
+
+* Get message UID
+
+ `getUID(message: Message, callback)`
+
+* Get mail through UID
+
+ `getMessageByUID(uid: number): Message`
+
+## compatibility
+
+- [DevEco Studio](https://developer.harmonyos.com/cn/develop/deveco-studio#download) Version: DevEco Studio 3.1 Beta 1 and above.
+- OpenHarmony SDK Version: API version 9 and above.
+
+## directory structure
+
+````
+|---- mail
+|| ---- entry # Sample code folder
+|| ---- mail # mail library folder
+| |---- src
+| |---- main
+| |---- ets
+| |---- mime_types
+| |---- JList. Ts # data set
+| |---- MimeTypeDetector. Ts # MIME file detector
+| |---- WeightedMimeType. Ts # MIME file properties
+| |---- emlformat
+| |---- Attachment. Ts # Attachment entity
+| |---- Boundary. Ts # Mail parsing assistance
+| |---- Data. Ts # Construct mail data entity
+| |---- EmlFormat. Ts # Mail parsing
+| |---- Result. Ts # Mail parsing results
+| |---- mail
+| |---- AttachmentBody. Ts # Attachment entity
+| |---- Flag. Ts # Session information for connecting to the mail server
+| |---- Folder. Ts # Mailbox management
+| |---- Message. Ts # Mail entity class
+| |---- MimeBodyPart. Ts # HTML embedded image entity
+| |---- MimeMessage. Ts # mail entity
+| |---- Properties. Ts # Session information for connecting to the mail server
+| |---- RecipientType. Ts # Recipient type
+| |---- ResponseCode. Ts # smpt server response code
+| |---- SocketUtil. Ts # socket tool
+| |---- Store. Ts # Email reception and management
+| |---- TransPort. Ts # Email sending
+| |---- Constant. Ts constant
+| |---- MailLogger. Ts logging tool
+| |---- Util. Ts tool
+| |---- index. Ets # external interface
+| |---- README. Md # Installation and usage
+````
+
+## Contribution code
+
+Any problem found during use can be raised [Issue](https://gitee.com/openharmony-sig/ohos_mail/issues) Of course, we also welcome you to send us [PR](https://gitee.com/openharmony-sig/ohos_mail/pulls)
+
+## Open source agreement
+
+This project is based on [Apache License 2.0](https://gitee.com/openharmony-sig/ohos_mail/blob/master/LICENSE) , Please enjoy and participate in open source freely.
\ No newline at end of file
diff --git a/README.md b/README.md
index 733d4bc58cc372c0ade11d70faf70303d86081d5..58d67313e8f479f4bc17d02b8d3c3a3d9d4deb07 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,7 @@
# mail
+简体中文 | [English](./README-EN.md)
+
## 简介
> 解析、构建eml格式的电子邮件,检测文件的MIME类型、邮件收发、管理。