Sending Email in Android using JavaMail API without using the default/built-in app在机器人发送电子邮件“发送不起作用”
我想根据上面的链接,所以我创建了三个班,使电子邮件应用程序为我的Android,做了一个简单的布局,但我可以”让它工作?当我在模拟器中启动应用程序并且布局出现时,我按下发送没有响应。我怀疑问题在于“发送”。有小费吗?
我也在清单中添加了。使用权限android:name =“android.permission.INTERNET”
做了一个简单的布局...每次我按发送按钮,它不发送,只打印出“buttonbutton”!
package gaia.feedback.com;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
public class GaiaFeedbackActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
final Button send = (Button) this.findViewById(R.id.send);
send.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
try {
GmailSender sender = new GmailSender("[email protected]", "password");
sender.sendMail("This is Subject",
"This is Body",
"[email protected]",
"[email protected]");
System.out.println("buttonbutton");
} catch (Exception e) {
Log.e("SendMail", e.getMessage(), e);
System.out.println("coolcool");
}
}
});
}
}
支票设备?... – 2012-03-31 18:29:49
希望你有包括3个库完美。 – Bhavin 2012-03-31 18:30:41
@萨米尔尚未完成它!但是,如果我在模拟器或设备上运行,它会产生什么影响吗? – 2012-03-31 18:32:23