Package com.googlecode.gmail4j

Examples of com.googlecode.gmail4j.GmailException


     */
    private HttpGmailConnection getGmailConnection() {
        if (connection instanceof HttpGmailConnection) {
            return (HttpGmailConnection) connection;
        }
        throw new GmailException("RssGmailClient requires HttpGmailConnection!");
    }
View Full Code Here


            } else {
                source.addRecipient(RecipientType.TO,
                        new InternetAddress(to.getEmail()));
            }
        } catch (final Exception e) {
            throw new GmailException("Failed adding To recipient", e);
        }
    }
View Full Code Here

    @Override
    public List<EmailAddress> getTo() {
        try {
            return getAddresses(RecipientType.TO);
        } catch (final Exception e) {
            throw new GmailException("Failed getting List of To recipients", e);
        }
    }
View Full Code Here

    @Override
    public List<EmailAddress> getCc() {
        try {
            return getAddresses(RecipientType.CC);
        } catch (final Exception e) {
            throw new GmailException("Failed getting List of Cc recipients", e);
        }
    }
View Full Code Here

                        from.getEmail(), from.getName()));
            } else {
                source.setFrom(new InternetAddress(from.getEmail()));
            }
        } catch (final Exception e) {
            throw new GmailException("Failed setting from address", e);
        }
    }
View Full Code Here

        if (from == null) {
            try {
                final InternetAddress f = (InternetAddress) source.getFrom()[0];
                from = new EmailAddress(f.getPersonal(), f.getAddress());
            } catch (final Exception e) {
                throw new GmailException("Failed getting from address", e);
            }
        }
        return from;
    }
View Full Code Here

    @Override
    public Date getSendDate() {
        try {
            return source.getSentDate();
        } catch (final Exception e) {
            throw new GmailException("Failed getting send date", e);
        }
    }
View Full Code Here

    @Override
    public void setSubject(final String subject) {
        try {
            source.setSubject(subject);
        } catch (final Exception e) {
            throw new GmailException("Failed setting subject", e);
        }
    }
View Full Code Here

    @Override
    public String getSubject() {
        try {
            return source.getSubject();
        } catch (final Exception e) {
            throw new GmailException("Failed getting message subject", e);
        }
    }
View Full Code Here

    @Override
    public void setContentText(final String contentText) {
        try {
            source.setText(contentText);
        } catch (final Exception e) {
            throw new GmailException("Failed settting content text", e);
        }
    }
View Full Code Here

TOP

Related Classes of com.googlecode.gmail4j.GmailException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.