使用 android 直接连接到 GMAIL [英] Connecting directly to GMAIL with android

查看:31
本文介绍了使用 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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆