Angular library simplifying generation of mailto links with TS
npm install ngx-mailto
height="256px" width="256px" style="text-align: center;"
src="https://cdn.jsdelivr.net/gh/anthonynahas/ngx-mailto@master/assets/angular-material-extensions-logo.svg">





from
src="https://raw.githubusercontent.com/anthonynahas/ngx-mailto/HEAD/assets/ex1.png">
to -->
src="https://raw.githubusercontent.com/anthonynahas/ngx-mailto/HEAD/assets/ex2.png">
If you like this project, support angular-material-extensions
by starring :star: and sharing it :loudspeaker:
View all the directives and components in action at https://anthonynahas.github.io/ngx-mailto
---
15.x---
Now add the library via the angular schematics
``shell`
ng add ngx-mailto
Now install ngx-mailto via:`shell`
npm install --save ngx-mailto
If you installed the library via angular schematics, you can skip this step
`typescript
import { NgxMailtoModule } from 'ngx-mailto';
@NgModule({
declarations: [AppComponent, ...],
imports: [NgxMailtoModule, ...],
bootstrap: [AppComponent]
})
export class AppModule {
}
`
Other modules in your application like for lazy loading import NgxMailtoModule into your feature module:
`typescript`
interface Mailto {
receiver?: string | string[];
subject?: string;
cc?: string | string[];
bcc?: string | string[];
body?: string;
}
#### via service NgxMailtoService
`html`
`typescript
import { Mailto, NgxMailtoService } from 'ngx-mailto';
emails: string[] = ['your_email@domain.de'];
cc: string[] = [];
bcc: string[] = [];
subject!: string;
body!: string;
mailto: Mailto = {
receiver: this.emails,
cc: this.cc,
bcc: this.bcc,
subject: undefined,
body: undefined
};
constructor(private mailtoService: NgxMailtoService) {
}
open(): void {
this.mailtoService.open(this.mailto);
}
`
#### via pipe mailto
`html`
Try me!
Build the library
`bash`
$ npm run build:lib
Serve the demo app
`bash``
$ npm start
---
1. Nahaus.de
Are you missing your project or you app? PR me to publish it on the README
---
This project is supported by jetbrains with 1 ALL PRODUCTS PACK OS LICENSE incl. webstorm
---
Copyright (c) 2022 Anthony Nahas. Licensed under the MIT License (MIT)
height="92px" width="92px" style="text-align: center;"
src="https://cdn.jsdelivr.net/gh/anthonynahas/ngx-mailto@master/assets/badge_made-in-germany.svg">