Coder Social home page Coder Social logo

courier's People

Contributors

aczeszejko-sochacki avatar aduprat avatar arcan1s avatar astorije avatar atanana avatar christopherdavenport avatar cortop avatar daddykotex avatar danielgratzl avatar dmurvihill avatar frosner avatar mikeokner avatar phile314-fh avatar rleibman avatar softprops avatar tzeman77 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

courier's Issues

Add an example which uses sslSocketFactory on the session builder

It took me a while to figure out why Courier couldn't connect to the outgoing e-mail server I use, on port 465. A usage example which specifically calls the sslSocketFactory definition on the session builder would have saved me a bunch of time.
Thank you for providing Courier to us.

too many arguments for method apply: ()courier.Mailer in class Builder

The examples on the wiki don't compile.

Specifically:

mailer(Envelope.from("you" `@` "gmail.com")
    .to("mom" `@` "gmail.com")
    .cc("dad" `@` "gmail.com")
    .subject("miss you")
    .content(Text("hi mom"))).onSuccess {
    case _ => println("message delivered")
}

Gives this result:

[error] /Users/zbeckman/Projects/Glimpulse/Server/project/glimpulse-server/test/utility/TestMail.scala:26: too many arguments for method apply: ()courier.Mailer in class Builder
[error]             mailer(Envelope.from("you" `@` "gmail.com")
[error]                   ^

Can't get courier via sbt

[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: ch.lightshed#courier_2.12;0.1.4: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn] Note: Unresolved dependencies path:
[warn] ch.lightshed:courier_2.12:0.1.4
...
[trace] Stack trace suppressed: run last :update for the full output.
[error] (
:update) sbt.ResolveException: unresolved dependency: ch.lightshed#cou
rier_2.12;0.1.4: not found

build.sbt:

resolvers += "lightshed-maven" at "http://dl.bintray.com/content/lightshed/maven"
libraryDependencies += "ch.lightshed" %% "courier" % "0.1.4"

Unable to send multipart messages.

On Windows Machines I get the following error, when I try to send multipart messages.
This is a bug with 1.0.0 and 2.0.0 too.

javax.mail.MessagingException: IOException while sending message
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1365)
at javax.mail.Transport.send0(Transport.java:255)
at javax.mail.Transport.send(Transport.java:124)
at courier.Mailer.$anonfun$apply$1(mailer.scala:37)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
at scala.concurrent.Future$.$anonfun$apply$1(Future.scala:654)
at scala.util.Success.$anonfun$map$1(Try.scala:251)
at scala.util.Success.map(Try.scala:209)
at scala.concurrent.Future.$anonfun$map$1(Future.scala:288)
at scala.concurrent.impl.Promise.liftedTree1$1(Promise.scala:29)
at scala.concurrent.impl.Promise.$anonfun$transform$1(Promise.scala:29)
at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:60)
at java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1402)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
Caused by: javax.activation.UnsupportedDataTypeException: no object DCH for MIME type multipart/mixed;
boundary="----=_Part_0_1807859575.1582802492185"
at javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java:896)
at javax.activation.DataHandler.writeTo(DataHandler.java:317)
at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1694)
at javax.mail.internet.MimeMessage.writeTo(MimeMessage.java:1913)
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1315)
... 16 common frames omitted

Charset problems

I have a problem with encoding. Am I doing something wrong or there is a problem with Coureir? How can I fix this?

I am sending:

  <html>
    <head>
      <meta charset="UTF-8" />
    </head>
    <body>
      <h1>Diacritics: żółć</h1>
    </body>
  </html>

and getting:

<h1>Diacritics: ?�??</h1>

the email looks like this:

------=_Part_0_1597551722.1405604258142
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<html>
    <head>
      <meta charset=3D"text/html; charset=3DUTF-8"/>
    </head>
    <body>
      <h1>Diacritics: ?=F3??</h1>
    </body>
  </html>
------=_Part_0_1597551722.1405604258142--

"Debug" doesn't seems to work

Hi,

I've tried to set debug as true but it doesn't print anything. Am I missing something ?

Currently, debug setting as "true" init a property mail.smtp.debug but isn't it better to just call setDebug(true) on the javax MailSession ?

Best regards

Testing

Hi,
did anyone try testing using Mock JavaMail these days? I'm getting an exception on the line val mailer = Mailer("localhost", 25)()

Future(Failure(com.sun.mail.util.MailConnectException: Couldn't connect to host, port: localhost, 25; timeout -1; nested exception is:java.net.ConnectException: Connection refused (Connection refused)))

Then momsInbox is empty.

@mcamou

Remove ls support

The ls project has been discontinued, therefore it makes sense to remove support from courier.

maintenance

Hi, I think this project needs a little maintenance and I would like to know if I can submit PR here and they will be considered or if I should go ahead and fork the repository.

  • upgrade javax.mail
  • make it opt-in to use a Future and allow for other type constructor to be used for asynchronous computation
  • scalafmt, sbt 1.0, etc.

I have already started the work on my fork https://github.com/daddykotex/courier

Thanks, David

do not know how to change g suites email font to courier

need help ....i have no idea how to change font to courier for my emails. I use g suites on andiod google pixel xl phone. If someone could explain to me as if i were a five year old I would be most appreciative.
thank you
shane

Can't send a multipart/related message

To have programs like Outlook display the HTML part of multipart (HTML & simple text) messages correctly, I have to use the MimeMultipart "multipart/related". I can't find an easy way to do this with courier. I think it could easily be added to the library as follows:

  • In case class courier.Multipart add an optional constructor parameter subtype: String = "mixed"
  • In method courier.Multipart#parts call new MimeMultipart(subtype)

With this, I think that my issue could be solved, so I can send an email like this:

Envelope
  .from(new InternetAddress(from))
  .to(new InternetAddress(to))
  .subject(subject)
  .content(Multipart(subtype = "related").text(textContent).html(htmlContent))

If you want I can provide a pull request.

Testing infrastructure

There seems to be no way currently of doing ScalaTest/Specs2 testing with courier, meaning some way to make it so the message isn't actually sent but stored somewhere where you can assert that an email with certain characteristics would have been sent.

Sending email in both text and html formats (multipart/alternative)

When trying to send email in both text and html format the Content-type of the email is set as multipart/mixed instead of multipart/alternative. Because of this gmail shows both the text and the html parts instead of showing only the most preferred one (the html version).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.