【问题标题】:How can i send feedback on particular email in android?如何在 android 中发送有关特定电子邮件的反馈?
【发布时间】:2016-01-25 19:33:54
【问题描述】:

在这里,我将通过特定的电子邮件发送我的数据。

数据包含发件人的姓名、发件人的电子邮件和发件人的消息。 以上所有信息到我的邮箱。

请帮我解决一下。

【问题讨论】:

  • 您的意思是您希望例如单击一个按钮并打开带有预填字段(发件人、主题和内容)的 GMail 编辑器?
  • 不,伙计,我不想这样。看,我填写了所有信息,然后单击发送按钮。我将在我的电子邮件中获得所有信息。
  • 我不想打开意图。选择器我直接发送电子邮件以单击我的活动按钮。
  • 这在android中可行吗?我想在许多网站上喜欢反馈类型。请帮帮我
  • @MilanGajera 如果您查看代码,则使用了 GMail 发件人,并且 GMail 服务器需要身份验证才能发送电子邮件。这取决于您将使用的 SMTP 服务器,因为协议不需要强制进行身份验证。

标签: java android


【解决方案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"); 

【讨论】:

    【解决方案2】:

    我正在使用这个包装器:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-09-12
      • 2017-02-04
      • 1970-01-01
      • 2014-04-10
      • 2016-11-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多