当前位置: 首页>>代码示例>>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;未经允许,请勿转载。