diff --git a/zh-cn/react-native-mail.md b/zh-cn/react-native-mail.md
index 14d01153435b1f44243dac6d53dee6e9c2365e00..3505174ab77be0a09146517e09145ff2428855df 100644
--- a/zh-cn/react-native-mail.md
+++ b/zh-cn/react-native-mail.md
@@ -1,5 +1,3 @@
-
-
> 模板版本:v0.2.2
@@ -24,7 +22,7 @@
进入到工程目录并输入以下命令:
->[!TIP] # 处替换为 tgz 包的路径
+> [!TIP] # 处替换为 tgz 包的路径
@@ -47,46 +45,56 @@ yarn add @react-native-oh-tpl/react-native-mail@file:#
> [!WARNING] 使用时 import 的库名不变。
```jsx
-import React, { Component } from 'react';
-import { View, Alert, Button } from 'react-native';
-import Mailer from 'react-native-mail';
+import React, { Component } from "react";
+import { View, Alert, Button } from "react-native";
+import Mailer from "react-native-mail";
export default class App extends Component {
-
handleEmail = () => {
- Mailer.mail({
- subject: 'need help',
- recipients: ['support@example.com'],
- ccRecipients: ['supportCC@example.com'],
- bccRecipients: ['supportBCC@example.com'],
- body: 'A Bold Body',
- customChooserTitle: 'This is my new title', // Android only (defaults to "Send Mail")
- isHTML: true,
- attachments: [{
- // Specify either `path` or `uri` to indicate where to find the file data.
- path: '', // /data/storage/el2/base/haps/entry/files/11.png
- uri: '', // file:///data/storage/el2/base/haps/entry/files/11.png
- // Specify either `type` or `mimeType` to indicate the type of data.
- type: '', // Mime Type: jpg, png, doc, ppt, html, pdf, csv
- mimeType: '', // - use only if you want to use custom type
- name: '', // Optional: Custom filename for attachment
- }]
- }, (error, event) => {
- Alert.alert(
- error,
- event,
- [
- {text: 'Ok', onPress: () => console.log('OK: Email Error Response')},
- {text: 'Cancel', onPress: () => console.log('CANCEL: Email Error Response')}
+ Mailer.mail(
+ {
+ subject: "need help",
+ recipients: ["support@example.com"],
+ ccRecipients: ["supportCC@example.com"],
+ bccRecipients: ["supportBCC@example.com"],
+ body: "A Bold Body",
+ customChooserTitle: "This is my new title", // Android only (defaults to "Send Mail")
+ isHTML: true,
+ attachments: [
+ {
+ // Specify either `path` or `uri` to indicate where to find the file data.
+ path: "", // /data/storage/el2/base/haps/entry/files/11.png
+ uri: "", // file:///data/storage/el2/base/haps/entry/files/11.png
+ // Specify either `type` or `mimeType` to indicate the type of data.
+ type: "", // Mime Type: jpg, png, doc, ppt, html, pdf, csv
+ mimeType: "", // - use only if you want to use custom type
+ name: "", // Optional: Custom filename for attachment
+ },
],
- { cancelable: true }
- )
- });
- }
+ },
+ (error, event) => {
+ Alert.alert(
+ error,
+ event,
+ [
+ {
+ text: "Ok",
+ onPress: () => console.log("OK: Email Error Response"),
+ },
+ {
+ text: "Cancel",
+ onPress: () => console.log("CANCEL: Email Error Response"),
+ },
+ ],
+ { cancelable: true }
+ );
+ }
+ );
+ };
render() {
return (
-
+