React native linking mail api support subject, body?

后端 未结 2 1386
囚心锁ツ
囚心锁ツ 2020-12-30 22:26

Hello I use Linking api to open mailto.

I try to call mail app using below

Linking.openURL(\'mailto://somethingemail@gmail.com&subject=abcdefg&am         


        
相关标签:
2条回答
  • 2020-12-30 23:01

    You need to remove the '//' in your url and add a '?' : mailto:somethingemail@gmail.com?subject=abcdefg&body=body

    0 讨论(0)
  • 2020-12-30 23:19

    Here are my cases:

    • SMS link:

    return (Platform.OS === 'android') ? sms:1-408-555-1212?body=yourMessage : sms:1-408-555-1212&body=yourMessage;

    • Mail link:

    return (Platform.OS === 'android') ? mailto:foo@example.com?cc=?subject=yourSubject&body=yourMessage : mailto:foo@example.com?cc=&subject=yourSubject&body=yourMessage;

    Note: your mail url must contain cc= even if you don't have any cc emails.

    • iOS: you use ?
    • android: you use &

    for the first parameter.

    0 讨论(0)
提交回复
热议问题