Connecting directly to GMAIL with android(使用 android 直接连接到 GMAIL)
问题描述
可能重复:
在 Android 中发送电子邮件使用 JavaMail API 而不使用默认/内置应用程序
我想通过 gmail 发送一封带有附加音频文件的电子邮件,我用我的应用程序录制了该文件.我可以在没有选择发送方法的选项的情况下从 android 发送带有附件的直接邮件吗?(蓝牙等)?我只想通过单击按钮发送带有附件的邮件.
I want to send an email with an attached audio file over gmail that i record with my application. Can I send a direct mail from android with attachment without getting the options to choose the method of sending? (bluetooth,etc etc ) ? I just want to send the mail with the attachment on the click of a button.
我可以用 android 做到这一点吗?另外,我有义务获得通过 gmail 使用 android 发送邮件的代码.
Can I do this with android? Also, i would be obliged is I could get the code for sending mail over gmail with android.
推荐答案
这是一个完整的例子,它向其他人发送后台电子邮件(使用 gmail 帐户),当然还有附件.使用 GMAIL 帐户发送带附件的电子邮件.
here is a complete example which sends a background email (using gmail account) to others, ofcourse with attachment. Send email with attachment using GMAIL account.
在此处查找示例项目在这个项目中,您需要在 MailSenderActivity 类中设置以下 gmail 帐户详细信息
Find an example project here
in this project you need to set the following gmail account details in MailSenderActivity class
private static final String GMAIL_EMAIL_ID = "";
private static final String GMAIL_ACCOUNT_PASSWORD = "";
private static final String TO_ADDRESSES = ""; // to email addresses separated by comma
如果您不需要 ZipUtility 类,请将其删除并根据需要使用它
If you don't need the ZipUtility class, remove that and use it according to your need
这篇关于使用 android 直接连接到 GMAIL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:使用 android 直接连接到 GMAIL
基础教程推荐
- NSString intValue 不能用于检索电话号码 2022-01-01
- 如何从 logcat 中删除旧数据? 2022-01-01
- 通过重定向链接在 Google Play 中打开应用 2022-01-01
- iOS4 创建后台定时器 2022-01-01
- AdMob 广告未在模拟器中显示 2022-01-01
- Cocos2d iPhone 非矩形精灵触摸检测 2022-01-01
- iPhone - 获取给定地点/时区的当前日期和时间并将其与同一地点的另一个日期/时间进行比较的正确方法 2022-01-01
- libGDX 从精灵或纹理中获取像素颜色 2022-01-01
- Android:getLastKnownLocation(LocationManager.NETWORK_PROVIDER 2022-01-01
- navigator.geolocation.getCurrentPosition 在 Android 浏览器上 2022-01-01
