From my android app I can send emails. But I can only send emails to one account. I was trying to modify the code in many different ways but I couldn't archive to send the email to more than one account.
I'm using this code:
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("username@gmail.com", "password");
sender.sendMail("This is Subject",
"This is Body",
"user@gmail.com", // This is not working
"user@yahoo.com"); //This is working
} catch (Exception e) {
Log.e("SendMail", e.getMessage(), e);
}
}
});
}
Here is the whole code: Sending Email in Android using JavaMail API without using the default/built-in app
Thanks.