Skip to content

Commit

Permalink
migrated email validation code to https://github.com/bbottema/email-r…
Browse files Browse the repository at this point in the history
…fc2822-validator (and started using a copy of this)
  • Loading branch information
bbottema committed Feb 26, 2016
1 parent ff808ca commit 8370db1
Show file tree
Hide file tree
Showing 10 changed files with 1,354 additions and 1,568 deletions.
11 changes: 6 additions & 5 deletions src/main/java/MailTest.java
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import org.codemonkey.simplejavamail.Mailer;
import org.codemonkey.simplejavamail.TransportStrategy;
import org.codemonkey.simplejavamail.email.Email;
import static javax.xml.bind.DatatypeConverter.parseBase64Binary;

import javax.mail.Message.RecipientType;
import javax.mail.MessagingException;
import javax.mail.Session;
import javax.mail.internet.MimeMessage;
import javax.mail.util.ByteArrayDataSource;
import java.io.IOException;
import java.util.Base64;
import java.util.Properties;

import org.codemonkey.simplejavamail.Mailer;
import org.codemonkey.simplejavamail.TransportStrategy;
import org.codemonkey.simplejavamail.email.Email;

/**
* Demonstration program for the Simple Java Mail framework.
*
Expand All @@ -31,7 +32,7 @@ public static void main(final String[] args) throws IOException, MessagingExcept
emailNormal.addAttachment("dresscode.txt", new ByteArrayDataSource("Black Tie Optional", "text/plain"));
emailNormal.addAttachment("location.txt", "On the moon!".getBytes(), "text/plain");
String base64String = "iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAABeElEQVRYw2NgoAAYGxu3GxkZ7TY1NZVloDcAWq4MxH+B+D8Qv3FwcOCgtwM6oJaDMTAUXOhmuYqKCjvQ0pdoDrCnmwNMTEwakC0H4u8GBgYC9Ap6DSD+iewAoIPm0ctyLqBlp9F8/x+YE4zpYT8T0LL16JYD8U26+B7oyz4sloPwenpYno3DchCeROsUbwa05A8eB3wB4kqgIxOAuArIng7EW4H4EhC/B+JXQLwDaI4ryZaDSjeg5mt4LCcFXyIn1fdSyXJQVt1OtMWGhoai0OD8T0W8GohZifE1PxD/o7LlsPLiFNAKRrwOABWptLAcqc6QGDAHQEOAYaAc8BNotsJAOgAUAosG1AFA/AtUoY3YEFhKMAvS2AE7iC1+WaG1H6gY3gzE36hUFJ8mqzbU1dUVBBqQBzTgIDQRkWo5qCZdpaenJ0Zx1aytrc0DDB0foIG1oAYKqC0IZK8D4n1AfA6IzwPxXpCFoGoZVEUDaRGGUTAKRgEeAAA2eGJC+ETCiAAAAABJRU5ErkJggg==";
emailNormal.addEmbeddedImage("thumbsup", Base64.getDecoder().decode(base64String), "image/png");
emailNormal.addEmbeddedImage("thumbsup", parseBase64Binary(base64String), "image/png");

This comment has been minimized.

Copy link
@bbottema

bbottema Feb 26, 2016

Author Owner

This was needed for Java 6/7. Java 8 will do it differently yet again.


// let's try producing and then consuming a MimeMessage ->
final MimeMessage mimeMessage = Mailer.produceMimeMessage(emailNormal, Session.getDefaultInstance(new Properties()));
Expand Down
228 changes: 101 additions & 127 deletions src/main/java/org/codemonkey/simplejavamail/Mailer.java

Large diffs are not rendered by default.

1,265 changes: 0 additions & 1,265 deletions src/main/java/org/codemonkey/simplejavamail/util/EmailAddress.java

This file was deleted.

This file was deleted.

This file was deleted.

Loading

1 comment on commit 8370db1

@bbottema
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implements #28.

Please sign in to comment.