/**
* Test a sending of a simple message
*/
@Test
public void testSendMessage() {
final GmailClient client = new ImapGmailClient();
final GmailConnection connection = new ImapGmailConnection();
connection.setLoginCredentials(conf.getGmailCredentials());
if (conf.useProxy() && (connection instanceof ProxyAware)) {
((ProxyAware) connection).setProxy(
conf.getProxyHost(), conf.getProxyPort());
((ProxyAware) connection).setProxyCredentials(
conf.getProxyCredentials());
}
client.setConnection(connection);
GmailMessage msg = new JavaMailGmailMessage();
msg.setSubject("Test mail subject. Unicode: ąžuolėlį");
msg.setContentText("Test mail content. Unicode: ąžuolėlį");
msg.addTo(new EmailAddress(conf.getTestRecipient()));
client.send(msg);
}