How to send SMS message reply to email address?

前端 未结 2 1679
天涯浪人
天涯浪人 2021-01-25 23:54

I have a simple SMS Activity that replies to a SMS message that was sent to the phone. Some SMS messages have the originating address as an email address. How do you compose a r

2条回答
  •  离开以前
    2021-01-26 00:40

    You can examine the originating address, and if it contains an @ (for instance) send an email to the recipient with the reply message.

    By this i mean you can launch the email client of the phone with the predefined message. Is that your intention?

    If it serves your purpose you can try this:

    Intent sendIntent = new Intent(Intent.ACTION_SEND);
    sendIntent.putExtra(Intent.EXTRA_TEXT, "email text");
    sendIntent.putExtra(Intent.EXTRA_SUBJECT, "Subject");
    sendIntent.setType("message/rfc822");
    startActivity(Intent.createChooser(sendIntent, "Title:"));
    

提交回复
热议问题