Search in sources :

Example 1 with EmailStartingBuilderImpl

use of org.simplejavamail.email.internal.EmailStartingBuilderImpl in project simple-java-mail by bbottema.

the class CliCommandLineConsumerResultHandler method processCliValidate.

@SuppressWarnings("deprecation")
private static void processCliValidate(List<CliReceivedOptionData> receivedOptions) {
    final EmailPopulatingBuilder emailBuilder = invokeBuilderApi(receivedOptions, CliBuilderApiType.EMAIL, new EmailStartingBuilderImpl());
    final MailerGenericBuilder<?> mailerBuilder = invokeBuilderApi(receivedOptions, CliBuilderApiType.MAILER, new MailerRegularBuilderImpl());
    mailerBuilder.buildMailer().validate(emailBuilder.buildEmail());
}
Also used : EmailPopulatingBuilder(org.simplejavamail.api.email.EmailPopulatingBuilder) EmailStartingBuilderImpl(org.simplejavamail.email.internal.EmailStartingBuilderImpl) MailerRegularBuilderImpl(org.simplejavamail.mailer.internal.MailerRegularBuilderImpl)

Example 2 with EmailStartingBuilderImpl

use of org.simplejavamail.email.internal.EmailStartingBuilderImpl in project simple-java-mail by bbottema.

the class CliCommandLineConsumerResultHandler method processCliSend.

@SuppressWarnings("deprecation")
private static void processCliSend(List<CliReceivedOptionData> receivedOptions) {
    final EmailPopulatingBuilder emailBuilder = invokeBuilderApi(receivedOptions, CliBuilderApiType.EMAIL, new EmailStartingBuilderImpl());
    final MailerGenericBuilder<?> mailerBuilder = invokeBuilderApi(receivedOptions, CliBuilderApiType.MAILER, new MailerRegularBuilderImpl());
    mailerBuilder.buildMailer().sendMail(emailBuilder.buildEmail());
}
Also used : EmailPopulatingBuilder(org.simplejavamail.api.email.EmailPopulatingBuilder) EmailStartingBuilderImpl(org.simplejavamail.email.internal.EmailStartingBuilderImpl) MailerRegularBuilderImpl(org.simplejavamail.mailer.internal.MailerRegularBuilderImpl)

Example 3 with EmailStartingBuilderImpl

use of org.simplejavamail.email.internal.EmailStartingBuilderImpl in project simple-java-mail by bbottema.

the class EmailConverter method outlookMsgToEmailBuilder.

/**
 * @param msgInputStream The content of an Outlook (.msg) message from which to create the {@link Email}.
 */
@SuppressWarnings("deprecation")
@NotNull
public static EmailFromOutlookMessage outlookMsgToEmailBuilder(@NotNull final InputStream msgInputStream, @Nullable final Pkcs12Config pkcs12Config) {
    EmailFromOutlookMessage fromMsgBuilder = ModuleLoader.loadOutlookModule().outlookMsgToEmailBuilder(msgInputStream, new EmailStartingBuilderImpl(), new EmailPopulatingBuilderFactoryImpl(), InternalEmailConverterImpl.INSTANCE);
    decryptAttachments(fromMsgBuilder.getEmailBuilder(), fromMsgBuilder.getOutlookMessage(), pkcs12Config);
    return fromMsgBuilder;
}
Also used : EmailPopulatingBuilderFactoryImpl(org.simplejavamail.email.internal.EmailPopulatingBuilderFactoryImpl) EmailStartingBuilderImpl(org.simplejavamail.email.internal.EmailStartingBuilderImpl) EmailFromOutlookMessage(org.simplejavamail.api.internal.outlooksupport.model.EmailFromOutlookMessage) NotNull(org.jetbrains.annotations.NotNull)

Example 4 with EmailStartingBuilderImpl

use of org.simplejavamail.email.internal.EmailStartingBuilderImpl in project simple-java-mail by bbottema.

the class EmailConverter method outlookMsgToEmailBuilder.

/**
 * @param msgFile The content of an Outlook (.msg) message from which to create the {@link Email}.
 * @param pkcs12Config Private key store for decrypting S/MIME encrypted attachments
 *                        (only needed when the message is encrypted rather than just signed).
 */
@SuppressWarnings({ "deprecation" })
@NotNull
public static EmailPopulatingBuilder outlookMsgToEmailBuilder(@NotNull final File msgFile, @Nullable final Pkcs12Config pkcs12Config) {
    checkNonEmptyArgument(msgFile, "msgFile");
    EmailFromOutlookMessage result = ModuleLoader.loadOutlookModule().outlookMsgToEmailBuilder(msgFile, new EmailStartingBuilderImpl(), new EmailPopulatingBuilderFactoryImpl(), InternalEmailConverterImpl.INSTANCE);
    return decryptAttachments(result.getEmailBuilder(), result.getOutlookMessage(), pkcs12Config);
}
Also used : EmailPopulatingBuilderFactoryImpl(org.simplejavamail.email.internal.EmailPopulatingBuilderFactoryImpl) EmailStartingBuilderImpl(org.simplejavamail.email.internal.EmailStartingBuilderImpl) EmailFromOutlookMessage(org.simplejavamail.api.internal.outlooksupport.model.EmailFromOutlookMessage) NotNull(org.jetbrains.annotations.NotNull)

Example 5 with EmailStartingBuilderImpl

use of org.simplejavamail.email.internal.EmailStartingBuilderImpl in project simple-java-mail by bbottema.

the class EmailConverter method outlookMsgToEmail.

/**
 * @param msgData The content of an Outlook (.msg) message from which to create the {@link Email}.
 * @param pkcs12Config Private key store for decrypting S/MIME encrypted attachments
 *                        (only needed when the message is encrypted rather than just signed).
 */
@SuppressWarnings("deprecation")
@NotNull
public static Email outlookMsgToEmail(@NotNull final String msgData, @Nullable final Pkcs12Config pkcs12Config) {
    checkNonEmptyArgument(msgData, "msgFile");
    EmailFromOutlookMessage result = ModuleLoader.loadOutlookModule().outlookMsgToEmailBuilder(msgData, new EmailStartingBuilderImpl(), new EmailPopulatingBuilderFactoryImpl(), InternalEmailConverterImpl.INSTANCE);
    return decryptAttachments(result.getEmailBuilder(), result.getOutlookMessage(), pkcs12Config).buildEmail();
}
Also used : EmailPopulatingBuilderFactoryImpl(org.simplejavamail.email.internal.EmailPopulatingBuilderFactoryImpl) EmailStartingBuilderImpl(org.simplejavamail.email.internal.EmailStartingBuilderImpl) EmailFromOutlookMessage(org.simplejavamail.api.internal.outlooksupport.model.EmailFromOutlookMessage) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

EmailStartingBuilderImpl (org.simplejavamail.email.internal.EmailStartingBuilderImpl)5 NotNull (org.jetbrains.annotations.NotNull)3 EmailFromOutlookMessage (org.simplejavamail.api.internal.outlooksupport.model.EmailFromOutlookMessage)3 EmailPopulatingBuilderFactoryImpl (org.simplejavamail.email.internal.EmailPopulatingBuilderFactoryImpl)3 EmailPopulatingBuilder (org.simplejavamail.api.email.EmailPopulatingBuilder)2 MailerRegularBuilderImpl (org.simplejavamail.mailer.internal.MailerRegularBuilderImpl)2