<!-- json
{
  "sourceId": "core-email-nodemailer-provider",
  "repositoryId": "travetto",
  "filePath": "module/email-nodemailer/doc/smtp.ts",
  "capabilityTags": ["email", "provider", "transport", "nodemailer"],
  "operationIds": ["email-transport-provider", "email-send-flow"],
  "applicability": ["framework-native"],
  "notes": [
    "Reference runtime provider wiring and transport integration points."
  ]
}
-->

# core-email-nodemailer-provider

- Source: `module/email-nodemailer/doc/smtp.ts`
- Capability tags: email, provider, transport, nodemailer
- Applicability: framework-native
- Notes:
  - Reference runtime provider wiring and transport integration points.

## Reference Code

```typescript
import { Config } from '@travetto/config';
import { InjectableFactory } from '@travetto/di';
import { NodemailerTransport } from '@travetto/email-nodemailer';

@Config('email.nodemailer')
export class NodemailerSmtpConfig {
  host: string = 'smtp.send-grid.net';
  port: number = 587;
  secure: boolean = false;
  username?: string = 'api-key';
  password?: string;
}

export class NodemailerTransportFactory {
  @InjectableFactory()
  static createSmtpTransport(config: NodemailerSmtpConfig): NodemailerTransport {
    return new NodemailerTransport({
      host: config.host,
      port: config.port,
      secure: config.secure,
      auth: config.password ? { user: config.username, pass: config.password } : undefined
    });
  }
}
```
