简体   繁体   English

在没有用户交互的情况下发送电子邮件-身份验证问题

[英]Sending emails without user interaction - authentication issue

im trying to send an email from my app without the user having to confirm. 即时通讯试图从我的应用程序发送电子邮件,而无需用户确认。 I' ve had some success with the winning answer from this post: sending-email-in-android-using-javamail-api-without-using-the-default-android-app However, this requires to put the email password into the code itself. 我已经从这篇文章的获奖答案中获得了一些成功: 在不使用默认Android应用的情况下在Android中使用Javamail-api发送电子邮件但是,这需要将电子邮件密码放入代码本身。 I'd rather not do this for security reasons. 出于安全原因,我宁愿不这样做。 Also I dont want to ask the users for their passwords. 我也不想向用户询问他们的密码。 That would probably confuse them. 这可能会使他们感到困惑。 (i would get sceptical if an app would aks me for my gmail pass) (如果我的应用程式要求我的gmail通行证,我会表示怀疑)

Is there any way to avoid having to specify the sending password, maybe by using AccountManager to authenticate with the phone's gmail account? 有什么方法可以避免必须指定发送密码,例如通过使用AccountManager来验证手机的gmail帐户?

Or, how would i go about enctypting the password if i chose to use my own? 或者,如果我选择使用自己的密码,我该如何加密密码?

Thanks! 谢谢!

If you want to send emails without prompting the user or having the user provide their credentials then you are going to need to provide the credentials yourself. 如果要发送电子邮件而不提示用户或不要求用户提供其凭据,则需要自己提供凭据。 As far as hiding the password string you can consider doing something like this: hiding strings in Obfuscated code 至于隐藏密码字符串,您可以考虑执行以下操作: 在混淆的代码中隐藏字符串

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

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