这是我的主要课程: -
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button login = (Button) findViewById(R.id.login);
login.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
BackgroundMail bm = new BackgroundMail(MainActivity.this);
bm.setGmailUserName("youremail@gmail.com");
bm.setGmailPassword("yourpassword");
bm.setMailTo("receivermail id");
bm.setFormSubject("Backgroundmail");
bm.setFormBody("TEsting");
bm.setSendingMessage("Sending mail...");
bm.setSendingMessageSuccess("Your message was sent successfully.");
bm.setProcessVisibility(true);
bm.send();
}
}
我也已将以下内容添加到我的清单中
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
我的问题是我的Gmail帐户没有发送电子邮件,(注意: - 我没有启用两步验证)
由于