Example usage for org.apache.commons.net.smtp SMTPClient getReply

List of usage examples for org.apache.commons.net.smtp SMTPClient getReply

Introduction

In this page you can find the example usage for org.apache.commons.net.smtp SMTPClient getReply.

Prototype

public int getReply() throws IOException 

Source Link

Document

Fetches a reply from the SMTP server and returns the integer reply code.

Usage

From source file:ca.rmen.android.networkmonitor.app.email.Emailer.java

private static void checkReply(SMTPClient sc) throws IOException {
    if (SMTPReply.isNegativeTransient(sc.getReplyCode())) {
        throw new RuntimeException("Transient SMTP error " + sc.getReply() + sc.getReplyString());
    } else if (SMTPReply.isNegativePermanent(sc.getReplyCode())) {
        throw new RuntimeException("Permanent SMTP error " + sc.getReply() + sc.getReplyString());
    }//from  w  ww .ja  va  2  s  .  c  om
}