如何在android中发送特定电子邮件的反馈?

时间:2016-01-23 08:58:38

标签: java android

我将在特定的电子邮件中发送我的数据。

数据包含发件人姓名,发件人电子邮件和发件人邮件。 所有上述信息都发送到我的邮箱。

请帮我解决。

2 个答案:

答案 0 :(得分:1)

首先创建您想要获得反馈的电子邮件。 所以你有你的电子邮件和密码。

然后创建一个包含具有id

的EditText的活动
 <EditText android:id="body"
    android:layout .... />
 <EditText android:id="useremail"
    ... />
 <EditText android:id="username"
    ... />

请点击以下链接: link

并填写以下信息:

            GMailSender sender = new GMailSender("username@gmail.com", "password");
            sender.sendMail("Users Feedback",   
                    "User Name:\t"+((EditText)getValueById(R.id.username).getText())+"\n"
                    +"User Email:\t"+((EditText)getValueById(R.id.useremail).getText())+"\n\n"
                    +"Content:\t"+((EditText)getValueById(R.id.body).getText()),   
                    "user@gmail.com",   
                    "user@yahoo.com"); 

答案 1 :(得分:0)

我正在使用这个包装器:

public static void sendEmail(Context ctx) {
        Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
        String[] recipients = new String[]{"***your.mail@example.com***"};// Replace your email id here 
        emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, recipients);
        emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "*TITLE*");// Replace your title with "TITLE" 
        emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, "");
        emailIntent.setType("***text/plain***"); // set content type here
        ctx.startActivity(Intent.createChooser(emailIntent, "Send E-mail..."));// it will provide you supported all app to send email.
    }
相关问题