直接连接到Gmail与Android连接到、直接、Android、Gmail

2023-09-04 05:07:20 作者:彩虹糖没有糖

可能重复:   Sending电子邮件在Android中使用JavaMail API不使用默认/内置应用

我想有一个附加的音频文件在Gmail中,我与我的应用程序记录发送电子邮件。我可以直接发送邮件机器人带有附件没有得到的选项中选择发送的方法是什么? (蓝牙,等等等等)?我只是想发送的邮件带有附件上的一个按钮的点击。

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? 另外,我不得不为我能得到code发送邮件的Gmail上使用的机器人。

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