简体   繁体   English

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

[英]How can i send feedback on particular email in android?

Here i am going to do send my data on particular E-mail. 在这里,我将通过特定的电子邮件发送数据。

Data contains name of the sender,email of the sender and message of the sender. 数据包含发件人名称,发件人电子邮件和发件人消息。 All above information to my mail. 以上所有信息发送至我的邮箱。

Please, help me to solve out. 请帮我解决。

First of all create the email where you want to get the feedback. 首先,在要获取反馈的位置创建电子邮件。 So you have your email and your password. 这样您便有了电子邮件和密码。

Then create an activity that contains an EditText with an id 然后创建一个包含ID为EditText的活动

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

just follow the link below: link 只需点击以下链接: 链接

and fill the following info: 并填写以下信息:

            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"); 

I'm using this wrapper: 我正在使用此包装器:

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.
    }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM