Scroll down and read the rest of the answer, you'll see that the sendMail()
method gives all the clues:
public synchronized void sendMail(String subject, String body, String sender, String recipients)
So:
"user@gmail.com"
is the sender (From field).
"user@yahoo.com"
is the recipient (To field). You can specify more with commas, eg
"user@yahoo.com,user_2@gmail.com"
You would also see that GMailSender
is just a class, not an Activity. Therefore, it does not need an Intent; just instantiate the class. Also, MailSenderActivity
is a code sample demonstrating the implementation of GMailSender
. You do not have to use it.
Eg
public void SendMail (View v) {
try {
GMailSender sender = new GMailSender("your_username@gmail.com", "password");
sender.sendMail("Subject",
"Email body",
"Fromfield@gmail.com",
"toField@example.com");
} catch (Exception e) {
Log.e("SendMail", e.getMessage(), e);
}
}
Also keep in mind Java naming conventions state that methods should start with a lowercase letter. You should adhere to those conventions and refactor your code appropriately.