當前位置: 首頁>>代碼示例>>Java>>正文


Java SmtpTransport類代碼示例

本文整理匯總了Java中com.fsck.k9.mail.transport.SmtpTransport的典型用法代碼示例。如果您正苦於以下問題:Java SmtpTransport類的具體用法?Java SmtpTransport怎麽用?Java SmtpTransport使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


SmtpTransport類屬於com.fsck.k9.mail.transport包,在下文中一共展示了SmtpTransport類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onNext

import com.fsck.k9.mail.transport.SmtpTransport; //導入依賴的package包/類
protected void onNext() {
    ConnectionSecurity securityType = (ConnectionSecurity) mSecurityTypeView.getSelectedItem();
    String uri;
    String username = null;
    String password = null;
    AuthType authType = null;
    if (mRequireLoginView.isChecked()) {
        username = mUsernameView.getText().toString();
        password = mPasswordView.getText().toString();
        authType = (AuthType) mAuthTypeView.getSelectedItem();
    }

    String newHost = mServerView.getText().toString();
    int newPort = Integer.parseInt(mPortView.getText().toString());
    String type = SmtpTransport.TRANSPORT_TYPE;
    ServerSettings server = new ServerSettings(type, newHost, newPort, securityType, authType, username, password);
    uri = Transport.createTransportUri(server);
    mAccount.deleteCertificate(newHost, newPort, CheckDirection.OUTGOING);
    mAccount.setTransportUri(uri);
    AccountSetupCheckSettings.actionCheckSettings(this, mAccount, CheckDirection.OUTGOING);
}
 
開發者ID:thialfihar,項目名稱:k-9,代碼行數:22,代碼來源:AccountSetupOutgoing.java

示例2: getInstance

import com.fsck.k9.mail.transport.SmtpTransport; //導入依賴的package包/類
public synchronized static Transport getInstance(Context context, StoreConfig storeConfig) throws MessagingException {
    String uri = storeConfig.getTransportUri();
    if (uri.startsWith("smtp")) {
        return new SmtpTransport(storeConfig, new DefaultTrustedSocketFactory(context));
    } else if (uri.startsWith("webdav")) {
        return new WebDavTransport(storeConfig);
    } else {
        throw new MessagingException("Unable to locate an applicable Transport for " + uri);
    }
}
 
開發者ID:scoute-dich,項目名稱:K9-MailClient,代碼行數:11,代碼來源:Transport.java

示例3: getInstance

import com.fsck.k9.mail.transport.SmtpTransport; //導入依賴的package包/類
public synchronized static Transport getInstance(Account account) throws MessagingException {
    String uri = account.getTransportUri();
    if (uri.startsWith("smtp")) {
        return new SmtpTransport(account);
    } else if (uri.startsWith("webdav")) {
        return new WebDavTransport(account);
    } else {
        throw new MessagingException("Unable to locate an applicable Transport for " + uri);
    }
}
 
開發者ID:thialfihar,項目名稱:k-9,代碼行數:11,代碼來源:Transport.java

示例4: decodeTransportUri

import com.fsck.k9.mail.transport.SmtpTransport; //導入依賴的package包/類
/**
 * Decodes the contents of transport-specific URIs and puts them into a {@link ServerSettings}
 * object.
 *
 * @param uri
 *         the transport-specific URI to decode
 *
 * @return A {@link ServerSettings} object holding the settings contained in the URI.
 *
 * @see SmtpTransport#decodeUri(String)
 * @see WebDavTransport#decodeUri(String)
 */
public static ServerSettings decodeTransportUri(String uri) {
    if (uri.startsWith("smtp")) {
        return SmtpTransport.decodeUri(uri);
    } else if (uri.startsWith("webdav")) {
        return WebDavTransport.decodeUri(uri);
    } else {
        throw new IllegalArgumentException("Not a valid transport URI");
    }
}
 
開發者ID:scoute-dich,項目名稱:K9-MailClient,代碼行數:22,代碼來源:Transport.java

示例5: createTransportUri

import com.fsck.k9.mail.transport.SmtpTransport; //導入依賴的package包/類
/**
 * Creates a transport URI from the information supplied in the {@link ServerSettings} object.
 *
 * @param server
 *         The {@link ServerSettings} object that holds the server settings.
 *
 * @return A transport URI that holds the same information as the {@code server} parameter.
 *
 * @see SmtpTransport#createUri(ServerSettings)
 * @see WebDavTransport#createUri(ServerSettings)
 */
public static String createTransportUri(ServerSettings server) {
    if (Type.SMTP == server.type) {
        return SmtpTransport.createUri(server);
    } else if (Type.WebDAV == server.type) {
        return WebDavTransport.createUri(server);
    } else {
        throw new IllegalArgumentException("Not a valid transport URI");
    }
}
 
開發者ID:scoute-dich,項目名稱:K9-MailClient,代碼行數:21,代碼來源:Transport.java

示例6: createTransportUri

import com.fsck.k9.mail.transport.SmtpTransport; //導入依賴的package包/類
/**
 * Creates a transport URI from the information supplied in the {@link ServerSettings} object.
 *
 * @param server
 *         The {@link ServerSettings} object that holds the server settings.
 *
 * @return A transport URI that holds the same information as the {@code server} parameter.
 *
 * @see SmtpTransport#createUri(ServerSettings)
 * @see WebDavTransport#createUri(ServerSettings)
 */
public static String createTransportUri(ServerSettings server) {
    if (SmtpTransport.TRANSPORT_TYPE.equals(server.type)) {
        return SmtpTransport.createUri(server);
    } else if (WebDavTransport.TRANSPORT_TYPE.equals(server.type)) {
        return WebDavTransport.createUri(server);
    } else {
        throw new IllegalArgumentException("Not a valid transport URI");
    }
}
 
開發者ID:thialfihar,項目名稱:k-9,代碼行數:21,代碼來源:Transport.java


注:本文中的com.fsck.k9.mail.transport.SmtpTransport類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。