如果用戶從我的應用程式發送電子郵件,它應該在電子郵件的“發件人”欄位中顯示用戶的電子郵件 ID。我正在做本地反應。請說出可以這樣做的任何技術或服務以及如何做到這一點。
uj5u.com熱心網友回復:
假設應用程式需要在用戶設備(android & ios)上打開客戶端電子郵件應用程式。
React Native 的核心是提供了一個鏈接庫,用于與外部應用程式進行深度鏈接。
const sendMail = async () => {
try {
const recipient = "[email protected]"
const title = "Acquire Unicorn metaverse start-up";
const body = "Don't lie behind Zuck back. Metaverse is the future..."
const url = `mailto:${recipient}?cc=&subject=${title}&body=${body}`;
await Linking.openURL(url);
} catch (error) {
console.log(error);
}
};
該函式將打開電子郵件客戶端應用程式,并通過 email,title以及body引數的電子郵件客戶端。
在https://reactnative.dev/docs/linking 上探索更多資訊
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/407481.html
標籤:
上一篇:為什么某些Pythonsmtplib郵件會發送到Gmail垃圾郵件檔案夾?
下一篇:用python創建電子郵件
