GmailSession gsession = new GmailSession
("someone","mypassword");
gsession.refreshInbox();
net.sf.jgmail.Message message = new
net.sf.jgmail.Message();
message.setSubject("Subject");
message.setBody("Body");
message.setTo("someone@gmail.com");
gsession.sendMessage(message);
Using this code, I get an exception. ClassCastException
on this line
NameValuePair[] composePostData = (NameValuePair
[])list.toArray();
.
Logged In: YES
user_id=1116445
Instead of
NameValuePair[] composePostData = (NameValuePair
[])list.toArray();
I use:
NameValuePair[] composePostData = new NameValuePair
[list.size()];
Object[] arList = list.toArray();
for (int i=0; i < arList.length; i++)
{
NameValuePair elt = (NameValuePair) arList[i];
composePostData[i] = elt;
}