Skip to content

benmerckx/smtpmailer

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

smtpmailer

Runs on sys targets and nodejs. Requires haxe 4+

final email = {
  subject: 'Subject',
  from: {address: 'mail@example.com', displayName: "It's me, Mario!"},
  to: [{address:'mail@example2.com', displayName:"Luigi Plumber"}],
  content: {
    text: 'hello',
    html: '<font color="red">hello</font>'
  },
  attachments: ['image.png']
}

smtpmailer.SmtpMailer.connect({
  host: 'hostname',
  port: 587,
  auth: {
    username: 'user',
    password: 'pass'
  }
}).next(mailer ->
  mailer.send(email).next(
    _ -> mailer.close()
  )
).handle(function(res) {
  switch res {
    case Success(_):
      trace('Email sent!');
    case Failure(e): {
      trace('Something went wrong: '+e);
    }
  }
});

About

Haxe SMTP mailer with support for SSL & StartTLS

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages