diff --git a/changelog.md b/changelog.md
--- a/changelog.md
+++ b/changelog.md
@@ -1,3 +1,6 @@
+## 0.1.2.1
+* Add compatibility with base64-1.0.
+
 ## 0.1.2.0
 * Add `FromJSON` and `ToJSON` instances for the `Token` type.
 
diff --git a/mailtrap.cabal b/mailtrap.cabal
--- a/mailtrap.cabal
+++ b/mailtrap.cabal
@@ -1,5 +1,5 @@
 name: mailtrap
-version: 0.1.2.0
+version: 0.1.2.1
 category: Email
 synopsis: Mailtrap API library.
 description:
diff --git a/src/Network/Mail/Mailtrap.hs b/src/Network/Mail/Mailtrap.hs
--- a/src/Network/Mail/Mailtrap.hs
+++ b/src/Network/Mail/Mailtrap.hs
@@ -68,6 +68,9 @@
 #endif
 -- base64
 import Data.ByteString.Base64 (encodeBase64)
+#if MIN_VERSION_base64(1,0,0)
+import Data.Base64.Types (extractBase64)
+#endif
 -- blaze-html
 import Text.Blaze.Html (Html)
 import Text.Blaze.Html.Renderer.Text (renderHtml)
@@ -270,7 +273,11 @@
   toJSON att = JSON.object $
     [ "filename" .= attachment_name att
     , "type" .= decodeUtf8 (attachment_type att)
+#if MIN_VERSION_base64(1,0,0)
+    , "content" .= extractBase64 (encodeBase64 $ attachment_content att)
+#else
     , "content" .= encodeBase64 (attachment_content att)
+#endif
     , "disposition" .=
       (case attachment_disposition att of
          Inline _ -> "inline" :: Text
