Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/benmerckx/smtpmailer

Haxe SMTP mailer with support for SSL & StartTLS
https://github.com/benmerckx/smtpmailer

Last synced: 20 days ago
JSON representation

Haxe SMTP mailer with support for SSL & StartTLS

Awesome Lists containing this project

README

        

# smtpmailer

Runs on sys targets and nodejs. Requires haxe 4+

```haxe
final email = {
subject: 'Subject',
from: {address: '[email protected]', displayName: "It's me, Mario!"},
to: [{address:'[email protected]', displayName:"Luigi Plumber"}],
content: {
text: 'hello',
html: 'hello'
},
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);
}
}
});
```