@visulima/email 1.0.0-alpha.2 → 1.0.0-alpha.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (231) hide show
  1. package/CHANGELOG.md +246 -0
  2. package/LICENSE.md +536 -899
  3. package/README.md +36 -21
  4. package/dist/crypto/index.d.ts +147 -4
  5. package/dist/crypto/index.js +1 -1
  6. package/dist/index.d.ts +785 -9
  7. package/dist/index.js +1 -1
  8. package/dist/packem_shared/{DkimSigner-pFd4c3fZ.js → DkimSigner-CT2DSHD1.js} +4 -4
  9. package/dist/packem_shared/Mail-D93oo_9g.js +1 -0
  10. package/dist/packem_shared/MailMessage-BvaH5tZZ.js +1 -0
  11. package/dist/packem_shared/{SmimeEncrypter-CBevU534.js → SmimeEncrypter-ZhHEgDwY.js} +2 -2
  12. package/dist/packem_shared/{SmimeSigner-CObA4jzT.js → SmimeSigner-CYSVF6ez.js} +1 -1
  13. package/dist/packem_shared/{ahaSendProvider-DlFKEQ6D.js → ahaSendProvider-DOAAW65O.js} +1 -1
  14. package/dist/packem_shared/{attachment-processor-2rHmfa7j.js → attachment-processor-DsmIomKc.js} +1 -1
  15. package/dist/packem_shared/{awsSesProvider-Ba-eVJxZ.js → awsSesProvider-DX1630Ms.js} +7 -7
  16. package/dist/packem_shared/azureProvider-EkNYKAiF.js +1 -0
  17. package/dist/packem_shared/{brevoProvider-5p6jjiK9.js → brevoProvider-CkR4U4RD.js} +1 -1
  18. package/dist/packem_shared/build-mime-message-6xstxaUV.js +2 -0
  19. package/dist/packem_shared/defineProvider-CtLH0VBE.js +1 -0
  20. package/dist/packem_shared/detectMimeType-bo5oxfnt.js +1 -0
  21. package/dist/packem_shared/failoverProvider-W5ctAhdC.js +1 -0
  22. package/dist/packem_shared/httpProvider-DUg1AQfO.js +1 -0
  23. package/dist/packem_shared/{infobipProvider-CtLwrUaP.js → infobipProvider-BhTsWi7e.js} +1 -1
  24. package/dist/packem_shared/{mailCrabProvider-CM_CFDca.js → mailCrabProvider-B7H6HwWu.js} +1 -1
  25. package/dist/packem_shared/mailPaceProvider-DRt6Z9Hr.js +1 -0
  26. package/dist/packem_shared/{mailerSendProvider-CeeIXFnW.js → mailerSendProvider-Dx_iHInH.js} +1 -1
  27. package/dist/packem_shared/mailgunProvider-ChkLGZZW.js +1 -0
  28. package/dist/packem_shared/mailjetProvider-BMRhNe6H.js +1 -0
  29. package/dist/packem_shared/{mailomatProvider-DMQmjKHT.js → mailomatProvider-CydV-JB6.js} +1 -1
  30. package/dist/packem_shared/{mailtrapProvider-BN3UBEQw.js → mailtrapProvider-CuAfJWDr.js} +1 -1
  31. package/dist/packem_shared/{make-request-BDzF9W9D.js → make-request-CaT4d5oC.js} +1 -1
  32. package/dist/packem_shared/{mandrillProvider-370y7CLu.js → mandrillProvider-BBeLbaw0.js} +1 -1
  33. package/dist/packem_shared/mockProvider-C0P1lKOy.js +1 -0
  34. package/dist/packem_shared/{nodemailerProvider-_w8QXMU-.js → nodemailerProvider-DFcvoVFv.js} +1 -1
  35. package/dist/packem_shared/{opentelemetryProvider-C_ZXOLSd.js → opentelemetryProvider-Dwv88G3O.js} +1 -1
  36. package/dist/packem_shared/{plunkProvider-DfJumQ4U.js → plunkProvider-BQyjG6YT.js} +1 -1
  37. package/dist/packem_shared/{postalProvider-Bavx2FcH.js → postalProvider-DPHQ620q.js} +1 -1
  38. package/dist/packem_shared/{postmarkProvider-DFC0uvjO.js → postmarkProvider-bMTC2gdJ.js} +1 -1
  39. package/dist/packem_shared/provider.d-DcfYeGJJ.d.ts +28 -0
  40. package/dist/packem_shared/readFile-BAVMZg5e-C4whBIPd.js +1 -0
  41. package/dist/packem_shared/resendProvider-Cns1tvF5.js +1 -0
  42. package/dist/packem_shared/roundRobinProvider-FvZQKl6n.js +1 -0
  43. package/dist/packem_shared/{scalewayProvider-be1HPimL.js → scalewayProvider-O1dHz7iJ.js} +1 -1
  44. package/dist/packem_shared/{sendGridProvider-BVI1sq3n.js → sendGridProvider-DmywC-eT.js} +1 -1
  45. package/dist/packem_shared/{smtpProvider-BV-ufR53.js → smtpProvider-Unjao_fn.js} +8 -8
  46. package/dist/packem_shared/sweegoProvider-D086G6xG.js +1 -0
  47. package/dist/packem_shared/types.d-CNnnk-Ya.d.ts +102 -0
  48. package/dist/packem_shared/types.d-nyR1ty1Q.d.ts +9 -0
  49. package/dist/packem_shared/types.d-wwpgA3to.d.ts +204 -0
  50. package/dist/packem_shared/validate-email-options-DPo3SgC0.js +1 -0
  51. package/dist/packem_shared/zeptomailProvider-DKKEpEsW.js +1 -0
  52. package/dist/providers/ahasend/index.d.ts +36 -3
  53. package/dist/providers/ahasend/index.js +1 -1
  54. package/dist/providers/aws-ses/index.d.ts +47 -3
  55. package/dist/providers/aws-ses/index.js +1 -1
  56. package/dist/providers/azure/index.d.ts +52 -3
  57. package/dist/providers/azure/index.js +1 -1
  58. package/dist/providers/brevo/index.d.ts +65 -3
  59. package/dist/providers/brevo/index.js +1 -1
  60. package/dist/providers/failover/index.d.ts +27 -3
  61. package/dist/providers/failover/index.js +1 -1
  62. package/dist/providers/http/index.d.ts +35 -3
  63. package/dist/providers/http/index.js +1 -1
  64. package/dist/providers/infobip/index.d.ts +56 -3
  65. package/dist/providers/infobip/index.js +1 -1
  66. package/dist/providers/mailcrab/index.d.ts +32 -3
  67. package/dist/providers/mailcrab/index.js +1 -1
  68. package/dist/providers/mailersend/index.d.ts +51 -3
  69. package/dist/providers/mailersend/index.js +1 -1
  70. package/dist/providers/mailgun/index.d.ts +73 -3
  71. package/dist/providers/mailgun/index.js +1 -1
  72. package/dist/providers/mailjet/index.d.ts +72 -3
  73. package/dist/providers/mailjet/index.js +1 -1
  74. package/dist/providers/mailomat/index.d.ts +40 -3
  75. package/dist/providers/mailomat/index.js +1 -1
  76. package/dist/providers/mailpace/index.d.ts +52 -3
  77. package/dist/providers/mailpace/index.js +1 -1
  78. package/dist/providers/mailtrap/index.d.ts +44 -3
  79. package/dist/providers/mailtrap/index.js +1 -1
  80. package/dist/providers/mandrill/index.d.ts +87 -3
  81. package/dist/providers/mandrill/index.js +1 -1
  82. package/dist/providers/mock/index.d.ts +59 -3
  83. package/dist/providers/mock/index.js +1 -1
  84. package/dist/providers/nodemailer/index.d.ts +38 -3
  85. package/dist/providers/nodemailer/index.js +1 -1
  86. package/dist/providers/opentelemetry/index.d.ts +529 -3
  87. package/dist/providers/opentelemetry/index.js +1 -1
  88. package/dist/providers/plunk/index.d.ts +38 -3
  89. package/dist/providers/plunk/index.js +1 -1
  90. package/dist/providers/postal/index.d.ts +48 -3
  91. package/dist/providers/postal/index.js +1 -1
  92. package/dist/providers/postmark/index.d.ts +60 -3
  93. package/dist/providers/postmark/index.js +1 -1
  94. package/dist/providers/resend/index.d.ts +51 -3
  95. package/dist/providers/resend/index.js +1 -1
  96. package/dist/providers/roundrobin/index.d.ts +27 -3
  97. package/dist/providers/roundrobin/index.js +1 -1
  98. package/dist/providers/scaleway/index.d.ts +44 -3
  99. package/dist/providers/scaleway/index.js +1 -1
  100. package/dist/providers/sendgrid/index.d.ts +84 -3
  101. package/dist/providers/sendgrid/index.js +1 -1
  102. package/dist/providers/smtp/index.d.ts +71 -3
  103. package/dist/providers/smtp/index.js +1 -1
  104. package/dist/providers/sweego/index.d.ts +40 -3
  105. package/dist/providers/sweego/index.js +1 -1
  106. package/dist/providers/zeptomail/index.d.ts +37 -3
  107. package/dist/providers/zeptomail/index.js +1 -1
  108. package/dist/template-engines/handlebars.d.ts +23 -22
  109. package/dist/template-engines/handlebars.js +1 -1
  110. package/dist/template-engines/html-to-text.d.ts +24 -24
  111. package/dist/template-engines/mjml.d.ts +10 -10
  112. package/dist/template-engines/react-email.d.ts +9 -9
  113. package/dist/template-engines/vue-email.d.ts +9 -9
  114. package/dist/utils/cache.d.ts +49 -48
  115. package/dist/utils/format-email-address.d.ts +8 -7
  116. package/dist/utils/normalize-email-aliases.d.ts +20 -20
  117. package/dist/utils/parse-address.d.ts +18 -17
  118. package/dist/utils/parse-address.js +1 -1
  119. package/dist/utils/validation/check-mx-records.d.ts +36 -35
  120. package/dist/utils/validation/disposable-email-domains.d.ts +1 -13
  121. package/dist/utils/validation/role-accounts.d.ts +18 -18
  122. package/dist/utils/validation/validate-email.d.ts +5 -5
  123. package/dist/utils/validation/verify-email.d.ts +45 -42
  124. package/dist/utils/validation/verify-email.js +1 -1
  125. package/dist/utils/validation/verify-smtp.d.ts +35 -34
  126. package/dist/utils/validation/verify-smtp.js +1 -1
  127. package/package.json +61 -61
  128. package/dist/attachment-helpers.d.ts +0 -64
  129. package/dist/crypto/dkim-signer.d.ts +0 -48
  130. package/dist/crypto/smime-encrypter.d.ts +0 -53
  131. package/dist/crypto/smime-signer.d.ts +0 -48
  132. package/dist/crypto/types.d.ts +0 -101
  133. package/dist/draft-mail-message.d.ts +0 -13
  134. package/dist/errors/email-error.d.ts +0 -17
  135. package/dist/errors/required-option-error.d.ts +0 -10
  136. package/dist/mail-message.d.ts +0 -425
  137. package/dist/mail.d.ts +0 -206
  138. package/dist/packem_shared/Mail-6Bltpy_p.js +0 -1
  139. package/dist/packem_shared/MailMessage-B76GPBBA.js +0 -1
  140. package/dist/packem_shared/azureProvider-CQYAkgVF.js +0 -1
  141. package/dist/packem_shared/build-mime-message-IYaUqqPJ.js +0 -2
  142. package/dist/packem_shared/defineProvider-B9rSklAJ.js +0 -1
  143. package/dist/packem_shared/detectMimeType-S8WRsNtY.js +0 -1
  144. package/dist/packem_shared/failoverProvider-CAHQQueo.js +0 -1
  145. package/dist/packem_shared/httpProvider-CZD6LZX3.js +0 -1
  146. package/dist/packem_shared/mailPaceProvider-B6yKvh6z.js +0 -1
  147. package/dist/packem_shared/mailgunProvider-mmjKzouh.js +0 -1
  148. package/dist/packem_shared/mailjetProvider-DwN6i0VA.js +0 -1
  149. package/dist/packem_shared/mockProvider-DN5ZwutD.js +0 -1
  150. package/dist/packem_shared/readFile-BlZxbhCU-C8bCdiA2.js +0 -1
  151. package/dist/packem_shared/resendProvider-CfqU7UdE.js +0 -1
  152. package/dist/packem_shared/roundRobinProvider-1WQnuKR8.js +0 -1
  153. package/dist/packem_shared/sweegoProvider-7419CSAq.js +0 -1
  154. package/dist/packem_shared/validate-email-options-DfJ7llf8.js +0 -1
  155. package/dist/packem_shared/zeptomailProvider-C2lh0Xmo.js +0 -1
  156. package/dist/providers/ahasend/provider.d.ts +0 -7
  157. package/dist/providers/ahasend/types.d.ts +0 -28
  158. package/dist/providers/aws-ses/provider.d.ts +0 -8
  159. package/dist/providers/aws-ses/types.d.ts +0 -38
  160. package/dist/providers/azure/provider.d.ts +0 -7
  161. package/dist/providers/azure/types.d.ts +0 -44
  162. package/dist/providers/brevo/provider.d.ts +0 -7
  163. package/dist/providers/brevo/types.d.ts +0 -57
  164. package/dist/providers/failover/provider.d.ts +0 -7
  165. package/dist/providers/failover/types.d.ts +0 -19
  166. package/dist/providers/http/provider.d.ts +0 -7
  167. package/dist/providers/http/types.d.ts +0 -27
  168. package/dist/providers/infobip/provider.d.ts +0 -7
  169. package/dist/providers/infobip/types.d.ts +0 -48
  170. package/dist/providers/mailcrab/provider.d.ts +0 -9
  171. package/dist/providers/mailcrab/types.d.ts +0 -22
  172. package/dist/providers/mailersend/provider.d.ts +0 -7
  173. package/dist/providers/mailersend/types.d.ts +0 -43
  174. package/dist/providers/mailgun/provider.d.ts +0 -7
  175. package/dist/providers/mailgun/types.d.ts +0 -65
  176. package/dist/providers/mailjet/provider.d.ts +0 -7
  177. package/dist/providers/mailjet/types.d.ts +0 -64
  178. package/dist/providers/mailomat/provider.d.ts +0 -7
  179. package/dist/providers/mailomat/types.d.ts +0 -32
  180. package/dist/providers/mailpace/provider.d.ts +0 -7
  181. package/dist/providers/mailpace/types.d.ts +0 -44
  182. package/dist/providers/mailtrap/provider.d.ts +0 -7
  183. package/dist/providers/mailtrap/types.d.ts +0 -36
  184. package/dist/providers/mandrill/provider.d.ts +0 -7
  185. package/dist/providers/mandrill/types.d.ts +0 -79
  186. package/dist/providers/mock/provider.d.ts +0 -8
  187. package/dist/providers/mock/types.d.ts +0 -50
  188. package/dist/providers/nodemailer/provider.d.ts +0 -7
  189. package/dist/providers/nodemailer/types.d.ts +0 -30
  190. package/dist/providers/opentelemetry/provider.d.ts +0 -8
  191. package/dist/providers/opentelemetry/types.d.ts +0 -31
  192. package/dist/providers/plunk/provider.d.ts +0 -7
  193. package/dist/providers/plunk/types.d.ts +0 -30
  194. package/dist/providers/postal/provider.d.ts +0 -7
  195. package/dist/providers/postal/types.d.ts +0 -40
  196. package/dist/providers/postmark/provider.d.ts +0 -7
  197. package/dist/providers/postmark/types.d.ts +0 -52
  198. package/dist/providers/provider.d.ts +0 -27
  199. package/dist/providers/resend/provider.d.ts +0 -7
  200. package/dist/providers/resend/types.d.ts +0 -43
  201. package/dist/providers/roundrobin/provider.d.ts +0 -7
  202. package/dist/providers/roundrobin/types.d.ts +0 -19
  203. package/dist/providers/scaleway/provider.d.ts +0 -7
  204. package/dist/providers/scaleway/types.d.ts +0 -36
  205. package/dist/providers/sendgrid/provider.d.ts +0 -7
  206. package/dist/providers/sendgrid/types.d.ts +0 -76
  207. package/dist/providers/smtp/provider.d.ts +0 -7
  208. package/dist/providers/smtp/types.d.ts +0 -63
  209. package/dist/providers/sweego/provider.d.ts +0 -7
  210. package/dist/providers/sweego/types.d.ts +0 -32
  211. package/dist/providers/utils/address-formatter.d.ts +0 -139
  212. package/dist/providers/utils/attachment-processor.d.ts +0 -58
  213. package/dist/providers/utils/index.d.ts +0 -4
  214. package/dist/providers/utils/payload-builder.d.ts +0 -78
  215. package/dist/providers/utils/provider-base.d.ts +0 -69
  216. package/dist/providers/zeptomail/provider.d.ts +0 -7
  217. package/dist/providers/zeptomail/types.d.ts +0 -29
  218. package/dist/template-engines/types.d.ts +0 -8
  219. package/dist/types.d.ts +0 -203
  220. package/dist/utils/build-mime-message.d.ts +0 -8
  221. package/dist/utils/create-logger.d.ts +0 -16
  222. package/dist/utils/format-email-addresses.d.ts +0 -8
  223. package/dist/utils/generate-boundary.d.ts +0 -7
  224. package/dist/utils/generate-message-id.d.ts +0 -6
  225. package/dist/utils/headers-to-record.d.ts +0 -9
  226. package/dist/utils/is-port-available.d.ts +0 -9
  227. package/dist/utils/make-request.d.ts +0 -18
  228. package/dist/utils/retry.d.ts +0 -10
  229. package/dist/utils/sanitize-header.d.ts +0 -14
  230. package/dist/utils/to-base64.d.ts +0 -8
  231. package/dist/utils/validation/validate-email-options.d.ts +0 -8
package/dist/index.d.ts CHANGED
@@ -1,9 +1,785 @@
1
- export { type AttachmentDataOptions, type AttachmentOptions, detectMimeType, generateContentId, readFileAsBuffer } from "./attachment-helpers.d.ts";
2
- export { default as EmailError } from "./errors/email-error.d.ts";
3
- export { default as RequiredOptionError } from "./errors/required-option-error.d.ts";
4
- export { createMail, Mail, type MailGlobalConfig, type SendableMessage } from "./mail.d.ts";
5
- export { default as MailMessage } from "./mail-message.d.ts";
6
- export type { Provider, ProviderFactory } from "./providers/provider.d.ts";
7
- export { defineProvider } from "./providers/provider.d.ts";
8
- export type { TemplateRenderer } from "./template-engines/types.d.ts";
9
- export type { Attachment, BaseConfig, CalendarEventOptions, EmailAddress, EmailHeaders, EmailOptions, EmailResult, EmailTag, FeatureFlags, ImmutableHeaders, MaybePromise, Priority, Receipt, Result, } from "./types.d.ts";
1
+ import { Buffer as Buffer$1 } from 'node:buffer';
2
+ import { ICalCalendar } from 'ical-generator';
3
+ import { b as EmailAddress, e as EmailHeaders, P as Priority, C as CalendarEventOptions, E as EmailOptions, A as Attachment, a as EmailResult, R as Result, d as Receipt } from "./packem_shared/types.d-wwpgA3to.js";
4
+ export { type B as BaseConfig, type c as EmailTag, type F as FeatureFlags, type I as ImmutableHeaders, type M as MaybePromise } from "./packem_shared/types.d-wwpgA3to.js";
5
+ import { E as EmailSigner, a as EmailEncrypter } from "./packem_shared/types.d-CNnnk-Ya.js";
6
+ import { T as TemplateRenderer } from "./packem_shared/types.d-nyR1ty1Q.js";
7
+ import { a as Provider } from "./packem_shared/provider.d-DcfYeGJJ.js";
8
+ export { type P as ProviderFactory, d as defineProvider } from "./packem_shared/provider.d-DcfYeGJJ.js";
9
+ /**
10
+ * Detects MIME type from filename using mime package.
11
+ * Falls back to application/octet-stream if not found.
12
+ * @param filename The filename or path.
13
+ * @returns MIME type or application/octet-stream as fallback.
14
+ */
15
+ declare const detectMimeType: (filename: string) => string;
16
+ /**
17
+ * Generates a Content-ID for inline attachments.
18
+ * @param filename The filename to generate CID from.
19
+ * @returns A unique Content-ID string.
20
+ */
21
+ declare const generateContentId: (filename: string) => string;
22
+ /**
23
+ * Reads file and returns its content as Buffer.
24
+ * @param filePath Path to the file.
25
+ * @returns Buffer containing file content.
26
+ */
27
+ declare const readFileAsBuffer: (filePath: string) => Promise<Buffer$1>;
28
+ /**
29
+ * Attachment options for helper methods
30
+ */
31
+ interface AttachmentOptions {
32
+ /**
33
+ * Content-ID for inline attachments (used in HTML with cid:).
34
+ * If not provided and contentDisposition is 'inline', will be auto-generated.
35
+ */
36
+ cid?: string;
37
+ /**
38
+ * Content disposition type.
39
+ * 'attachment' (default) or 'inline'.
40
+ */
41
+ contentDisposition?: "attachment" | "inline";
42
+ /**
43
+ * MIME type of the attachment.
44
+ * If not provided, will be detected from filename.
45
+ */
46
+ contentType?: string;
47
+ /**
48
+ * Content transfer encoding.
49
+ * Examples: 'base64', '7bit', 'quoted-printable'.
50
+ */
51
+ encoding?: string;
52
+ /**
53
+ * Custom filename.
54
+ * Used when different from the file path.
55
+ */
56
+ filename?: string;
57
+ /**
58
+ * Custom headers for this attachment.
59
+ */
60
+ headers?: Record<string, string>;
61
+ }
62
+ /**
63
+ * Attachment data options (for raw data attachments)
64
+ */
65
+ interface AttachmentDataOptions extends AttachmentOptions {
66
+ /**
67
+ * Filename for the attachment.
68
+ * Required for raw data attachments.
69
+ */
70
+ filename: string;
71
+ }
72
+ interface ErrorProperties {
73
+ cause?: unknown;
74
+ hint?: ErrorHint;
75
+ location?: ErrorLocation;
76
+ message?: string;
77
+ name: string;
78
+ stack?: string;
79
+ title?: string;
80
+ }
81
+ interface ErrorLocation {
82
+ column?: number;
83
+ file?: string;
84
+ line?: number;
85
+ }
86
+ /**
87
+ * A message that explains to the user how they can fix the error.
88
+ * @example
89
+ * ```ts
90
+ * const error = new VisulimaError({
91
+ * hint: "Try running `npm install` to install missing dependencies.",
92
+ * location: {
93
+ * file: "src/index.ts",
94
+ * line: 1,
95
+ * column: 1,
96
+ * },
97
+ * message: "Cannot find module 'react'",
98
+ * name: "ModuleNotFoundError",
99
+ * });
100
+ * ```
101
+ *
102
+ * For more complex hints, you can pass an array of strings or a single string in markdown format.
103
+ */
104
+ type ErrorHint = string[] | string;
105
+ declare class VisulimaError extends Error {
106
+ loc: ErrorLocation | undefined;
107
+ title: string | undefined;
108
+ /**
109
+ * A message that explains to the user how they can fix the error.
110
+ */
111
+ hint: ErrorHint | undefined;
112
+ type: string;
113
+ constructor({
114
+ cause,
115
+ hint,
116
+ location,
117
+ message,
118
+ name,
119
+ stack,
120
+ title
121
+ }: ErrorProperties);
122
+ setLocation(location: ErrorLocation): void;
123
+ setName(name: string): void;
124
+ setMessage(message: string): void;
125
+ setHint(hint: ErrorHint): void;
126
+ }
127
+ /**
128
+ * Will return an array of all causes in the error in the order they occurred.
129
+ */
130
+ /**
131
+ * Base error class for email package operations.
132
+ * @param component The component name where the error occurred.
133
+ * @param message The error message describing what went wrong.
134
+ * @param options Optional error options including cause, code, and hint.
135
+ */
136
+ declare class EmailError extends VisulimaError {
137
+ readonly component: string;
138
+ readonly code?: string;
139
+ constructor(component: string, message: string, options?: {
140
+ cause?: Error | unknown;
141
+ code?: string;
142
+ hint?: string | string[];
143
+ });
144
+ }
145
+ /**
146
+ * Error for missing required options
147
+ * @param component The component name where the error occurred
148
+ * @param name The name(s) of the missing required option(s)
149
+ */
150
+ declare class RequiredOptionError extends EmailError {
151
+ constructor(component: string, name: string | string[]);
152
+ }
153
+ type AddressInput = EmailAddress | EmailAddress[] | string | string[];
154
+ /**
155
+ * Mail message builder - provides fluent interface for building emails.
156
+ */
157
+ declare class MailMessage {
158
+ private fromAddress?;
159
+ private toAddresses;
160
+ private ccAddresses;
161
+ private bccAddresses;
162
+ private subjectText;
163
+ private textContent?;
164
+ private textCharset;
165
+ private autoTextEnabled;
166
+ private htmlContent?;
167
+ private htmlCharset;
168
+ private dateValue?;
169
+ private returnPathAddress?;
170
+ private senderAddress?;
171
+ private headers;
172
+ private attachments;
173
+ private replyToAddress?;
174
+ private priorityValue?;
175
+ private tagsValue;
176
+ private signer?;
177
+ private encrypter?;
178
+ private logger?;
179
+ private icalEventData?;
180
+ /**
181
+ * Sets the sender address.
182
+ * @param address The sender email address (string or EmailAddress object).
183
+ * @returns This instance for method chaining.
184
+ */
185
+ from(address: EmailAddress | string): this;
186
+ /**
187
+ * Sets the recipient address(es).
188
+ * @param address The recipient email address(es) (string, EmailAddress, or arrays of either).
189
+ * @returns This instance for method chaining.
190
+ */
191
+ to(address: AddressInput): this;
192
+ /**
193
+ * Sets the CC recipient address(es).
194
+ * @param address The CC recipient email address(es) (string, EmailAddress, or arrays of either).
195
+ * @returns This instance for method chaining.
196
+ */
197
+ cc(address: AddressInput): this;
198
+ /**
199
+ * Sets the BCC recipient address(es).
200
+ * @param address The BCC recipient email address(es) (string, EmailAddress, or arrays of either).
201
+ * @returns This instance for method chaining.
202
+ */
203
+ bcc(address: AddressInput): this;
204
+ /**
205
+ * Sets the subject line for the email message.
206
+ * @param text The subject text to set.
207
+ * @returns This instance for method chaining.
208
+ */
209
+ subject(text: string): this;
210
+ /**
211
+ * Sets the plain text content of the email.
212
+ * @param content The plain text content to set.
213
+ * @param charset Optional charset for the text content (default: 'utf8').
214
+ * @returns This instance for method chaining.
215
+ */
216
+ text(content: string, charset?: string): this;
217
+ /**
218
+ * Sets the HTML content of the email.
219
+ * @param content The HTML content to set.
220
+ * @param charset Optional charset for the HTML content (default: 'utf8').
221
+ * @returns This instance for method chaining.
222
+ */
223
+ html(content: string, charset?: string): this;
224
+ /**
225
+ * Sets a custom email header.
226
+ * @param name The header name to set.
227
+ * @param value The header value to set.
228
+ * @returns This instance for method chaining.
229
+ */
230
+ header(name: string, value: string): this;
231
+ /**
232
+ * Sets multiple headers.
233
+ * Accepts both Record&lt;string, string> and ImmutableHeaders.
234
+ * @param headers The headers to set (Record or ImmutableHeaders).
235
+ * @returns This instance for method chaining.
236
+ */
237
+ setHeaders(headers: EmailHeaders): this;
238
+ /**
239
+ * Attaches a file from path (reads file from filesystem).
240
+ * Similar to Laravel's attach() method.
241
+ * @param filePath The absolute or relative filesystem path to the file to attach.
242
+ * @param options Optional attachment configuration (filename, contentType, etc.).
243
+ * @returns This instance for method chaining.
244
+ * @example
245
+ * ```ts
246
+ * message.attachFromPath('/path/to/file.pdf')
247
+ * message.attachFromPath('/path/to/file.pdf', { filename: 'custom-name.pdf' })
248
+ * ```
249
+ */
250
+ attachFromPath(filePath: string, options?: AttachmentOptions): Promise<this>;
251
+ /**
252
+ * Attaches raw data (string or Buffer).
253
+ * Similar to Laravel's attachData() method.
254
+ * @param content The content to attach (string or Buffer).
255
+ * @param options Attachment options including filename.
256
+ * @returns This instance for method chaining.
257
+ * @example
258
+ * ```ts
259
+ * message.attachData(Buffer.from('content'), 'file.txt')
260
+ * message.attachData('content', 'file.txt', { contentType: 'text/plain' })
261
+ * ```
262
+ */
263
+ attachData(content: string | Buffer, options: AttachmentDataOptions): this;
264
+ /**
265
+ * Embeds an inline attachment from file path (for images in HTML).
266
+ * Similar to Laravel's embed() method.
267
+ * Returns the Content-ID that can be used in HTML: &lt;img src="cid:{cid}">.
268
+ * @param filePath The path to the file to embed.
269
+ * @param options Optional attachment options (filename, contentType, etc.).
270
+ * @returns The Content-ID string that can be used in HTML.
271
+ * @example
272
+ * ```ts
273
+ * const cid = await message.embedFromPath('/path/to/logo.png')
274
+ * message.html(`<img src="cid:${cid}">`)
275
+ * ```
276
+ */
277
+ embedFromPath(filePath: string, options?: Omit<AttachmentOptions, "contentDisposition" | "cid">): Promise<string>;
278
+ /**
279
+ * Embeds raw data as inline attachment (for images in HTML).
280
+ * Similar to Laravel's embedData() method.
281
+ * Returns the Content-ID that can be used in HTML: &lt;img src="cid:{cid}">.
282
+ * @param content The content to embed (string or Buffer).
283
+ * @param filename The filename for the embedded attachment.
284
+ * @param options Optional attachment options (contentType, etc.).
285
+ * @returns The Content-ID string that can be used in HTML.
286
+ * @example
287
+ * ```ts
288
+ * const imageBuffer = Buffer.from('...')
289
+ * const cid = message.embedData(imageBuffer, 'logo.png', { contentType: 'image/png' })
290
+ * message.html(`<img src="cid:${cid}">`)
291
+ * ```
292
+ */
293
+ embedData(content: string | Buffer, filename: string, options?: Omit<AttachmentDataOptions, "filename" | "contentDisposition" | "cid">): string;
294
+ /**
295
+ * Sets the reply-to address.
296
+ * @param address The reply-to email address (string or EmailAddress object).
297
+ * @returns This instance for method chaining.
298
+ */
299
+ replyTo(address: EmailAddress | string): this;
300
+ /**
301
+ * Sets the date header for the email.
302
+ * @param date The date to set (Date object or ISO string).
303
+ * @returns This instance for method chaining.
304
+ */
305
+ date(date: Date | string): this;
306
+ /**
307
+ * Sets the return-path address (bounce address).
308
+ * @param address The return-path email address (string or EmailAddress object).
309
+ * @returns This instance for method chaining.
310
+ */
311
+ returnPath(address: EmailAddress | string): this;
312
+ /**
313
+ * Sets the sender address (different from From - used when From contains multiple addresses).
314
+ * @param address The sender email address (string or EmailAddress object).
315
+ * @returns This instance for method chaining.
316
+ */
317
+ sender(address: EmailAddress | string): this;
318
+ /**
319
+ * Adds recipient address(es) without replacing existing ones.
320
+ * @param address The recipient email address(es) (string, EmailAddress, or arrays of either).
321
+ * @returns This instance for method chaining.
322
+ */
323
+ addTo(address: AddressInput): this;
324
+ /**
325
+ * Adds CC recipient address(es) without replacing existing ones.
326
+ * @param address The CC recipient email address(es) (string, EmailAddress, or arrays of either).
327
+ * @returns This instance for method chaining.
328
+ */
329
+ addCc(address: AddressInput): this;
330
+ /**
331
+ * Adds BCC recipient address(es) without replacing existing ones.
332
+ * @param address The BCC recipient email address(es) (string, EmailAddress, or arrays of either).
333
+ * @returns This instance for method chaining.
334
+ */
335
+ addBcc(address: AddressInput): this;
336
+ /**
337
+ * Adds reply-to address(es) without replacing existing ones.
338
+ * @param address The reply-to email address(es) (string, EmailAddress, or arrays of either).
339
+ * @returns This instance for method chaining.
340
+ */
341
+ addReplyTo(address: EmailAddress | string | (EmailAddress | string)[]): this;
342
+ /**
343
+ * Adds from address(es) without replacing existing ones.
344
+ * @param address The sender email address(es) (string, EmailAddress, or arrays of either).
345
+ * @returns This instance for method chaining.
346
+ */
347
+ addFrom(address: EmailAddress | string | (EmailAddress | string)[]): this;
348
+ /**
349
+ * Sets the email priority.
350
+ * @param priority The priority level ('high', 'normal', or 'low').
351
+ * @returns This instance for method chaining.
352
+ */
353
+ priority(priority: Priority): this;
354
+ /**
355
+ * Sets email tags for categorization.
356
+ * @param tags The tags to set (string or array of strings).
357
+ * @returns This instance for method chaining.
358
+ */
359
+ tags(tags: string | string[]): this;
360
+ /**
361
+ * Signs the email message using a signer (DKIM or S/MIME).
362
+ * @param signer The signer instance to use.
363
+ * @example
364
+ * ```ts
365
+ * import { createDkimSigner } from '@visulima/email/crypto';
366
+ * const signer = createDkimSigner({
367
+ * domainName: 'example.com',
368
+ * keySelector: 'default',
369
+ * privateKey: '-----BEGIN PRIVATE KEY-----...'
370
+ * });
371
+ * message.sign(signer)
372
+ * ```
373
+ */
374
+ sign(signer: EmailSigner): this;
375
+ /**
376
+ * Encrypts the email message using an encrypter (S/MIME).
377
+ * @param encrypter The encrypter instance to use.
378
+ * @example
379
+ * ```ts
380
+ * import { createSmimeEncrypter } from '@visulima/email/crypto';
381
+ * const encrypter = createSmimeEncrypter({
382
+ * certificates: '/path/to/certificate.crt'
383
+ * });
384
+ * message.encrypt(encrypter)
385
+ * ```
386
+ */
387
+ encrypt(encrypter: EmailEncrypter): this;
388
+ /**
389
+ * Sets the logger instance for this message.
390
+ * @param logger The logger instance (Console) to use for logging.
391
+ * @returns This instance for method chaining.
392
+ * @example
393
+ * ```ts
394
+ * message.logger(console)
395
+ * ```
396
+ */
397
+ setLogger(logger: Console): this;
398
+ /**
399
+ * Attach a calendar event and define contents as string or function.
400
+ * @param contents The calendar content as a string or a function that receives an ICalCalendar instance.
401
+ * @param options Optional calendar event options (method, alternativeText).
402
+ * @returns This instance for method chaining.
403
+ * @example
404
+ * ```ts
405
+ * message.icalEvent((calendar) => {
406
+ * calendar.createEvent({
407
+ * start: new Date(),
408
+ * summary: 'Meeting'
409
+ * });
410
+ * })
411
+ * message.icalEvent('BEGIN:VCALENDAR...')
412
+ * ```
413
+ */
414
+ icalEvent(contents: ((calendar: ICalCalendar) => void) | string, options?: CalendarEventOptions): this;
415
+ /**
416
+ * Attach a calendar event and load contents from a file.
417
+ * @param file The file path (string or URL) to load the calendar event from.
418
+ * @param options Optional calendar event options (method, alternativeText).
419
+ * @returns This instance for method chaining.
420
+ * @example
421
+ * ```ts
422
+ * message.icalEventFromFile('/path/to/event.ics')
423
+ * message.icalEventFromFile(new URL('file:///path/to/event.ics'))
424
+ * ```
425
+ */
426
+ icalEventFromFile(file: string | URL, options?: CalendarEventOptions): this;
427
+ /**
428
+ * Attach a calendar event and load contents from a URL.
429
+ * @param url The URL to fetch the calendar event from.
430
+ * @param options Optional calendar event options (method, alternativeText).
431
+ * @returns This instance for method chaining.
432
+ * @example
433
+ * ```ts
434
+ * message.icalEventFromUrl('https://example.com/event.ics')
435
+ * ```
436
+ */
437
+ icalEventFromUrl(url: string, options?: CalendarEventOptions): this;
438
+ /**
439
+ * Renders a template and sets as HTML content.
440
+ * Accepts a render function for flexible template engine support.
441
+ * @param render The template renderer function.
442
+ * @param template The template content (string, React component, etc.).
443
+ * @param data Optional data/variables to pass to the template.
444
+ * @param options Optional renderer-specific options.
445
+ * @param options.autoText Whether to auto-generate text version from HTML (default: true).
446
+ * @returns This instance for method chaining.
447
+ * @example
448
+ * ```ts
449
+ * import { renderHandlebars } from '@visulima/email/template/handlebars';
450
+ * message.view(renderHandlebars, '<h1>Hello {{name}}!</h1>', { name: 'John' })
451
+ *
452
+ * import { renderMjml } from '@visulima/email/template/mjml';
453
+ * message.view(renderMjml, mjmlTemplate)
454
+ *
455
+ * import { renderReactEmail } from '@visulima/email/template/react-email';
456
+ * message.view(renderReactEmail, <WelcomeEmail name="John" />)
457
+ * ```
458
+ */
459
+ view(render: TemplateRenderer, template: unknown, data?: Record<string, unknown>, options?: {
460
+ [key: string]: unknown;
461
+ autoText?: boolean;
462
+ }): Promise<this>;
463
+ /**
464
+ * Renders a text template and sets as text content.
465
+ * @param render The template renderer function.
466
+ * @param template The text template content.
467
+ * @param data Optional data/variables to pass to the template.
468
+ * @param options Optional renderer-specific options.
469
+ * @returns This instance for method chaining.
470
+ * @example
471
+ * ```ts
472
+ * import { renderHandlebars } from '@visulima/email/template/handlebars';
473
+ * message.viewText(renderHandlebars, 'Hello {{name}}!', { name: 'John' })
474
+ * ```
475
+ */
476
+ viewText(render: TemplateRenderer, template: string, data?: Record<string, unknown>, options?: Record<string, unknown>): Promise<this>;
477
+ /**
478
+ * Builds the email options.
479
+ * @returns The built email options ready for sending.
480
+ * @throws {Error} When required fields (from, to, subject, content) are missing.
481
+ */
482
+ build(): Promise<EmailOptions>;
483
+ /**
484
+ * Gets the subject of the email.
485
+ * @returns The subject text or empty string if not set.
486
+ */
487
+ getSubject(): string;
488
+ /**
489
+ * Gets the from address.
490
+ * @returns The from address or undefined if not set.
491
+ */
492
+ getFrom(): EmailAddress | undefined;
493
+ /**
494
+ * Gets the recipient addresses.
495
+ * @returns Array of recipient addresses.
496
+ */
497
+ getTo(): EmailAddress[];
498
+ /**
499
+ * Gets the CC recipient addresses.
500
+ * @returns Array of CC recipient addresses.
501
+ */
502
+ getCc(): EmailAddress[];
503
+ /**
504
+ * Gets the BCC recipient addresses.
505
+ * @returns Array of BCC recipient addresses.
506
+ */
507
+ getBcc(): EmailAddress[];
508
+ /**
509
+ * Gets the reply-to address.
510
+ * @returns The reply-to address or undefined if not set.
511
+ */
512
+ getReplyTo(): EmailAddress | undefined;
513
+ /**
514
+ * Gets the sender address.
515
+ * @returns The sender address or undefined if not set.
516
+ */
517
+ getSender(): EmailAddress | undefined;
518
+ /**
519
+ * Gets the return-path address.
520
+ * @returns The return-path address or undefined if not set.
521
+ */
522
+ getReturnPath(): EmailAddress | undefined;
523
+ /**
524
+ * Gets the date header.
525
+ * @returns The date or undefined if not set.
526
+ */
527
+ getDate(): Date | undefined;
528
+ /**
529
+ * Gets the priority of the email.
530
+ * @returns The priority ('high', 'normal', 'low') or undefined if not set.
531
+ */
532
+ getPriority(): Priority | undefined;
533
+ /**
534
+ * Gets the plain text content.
535
+ * @returns The text content or undefined if not set.
536
+ */
537
+ getTextBody(): string | undefined;
538
+ /**
539
+ * Gets the charset for the text content.
540
+ * @returns The text charset (default: 'utf8').
541
+ */
542
+ getTextCharset(): string;
543
+ /**
544
+ * Gets the HTML content.
545
+ * @returns The HTML content or undefined if not set.
546
+ */
547
+ getHtmlBody(): string | undefined;
548
+ /**
549
+ * Gets the charset for the HTML content.
550
+ * @returns The HTML charset (default: 'utf8').
551
+ */
552
+ getHtmlCharset(): string;
553
+ /**
554
+ * Gets the attachments.
555
+ * @returns Array of attachments.
556
+ */
557
+ getAttachments(): Attachment[];
558
+ /**
559
+ * Attempts to auto-generate text content from HTML.
560
+ * @param html The HTML content to convert.
561
+ * @private
562
+ */
563
+ private tryAutoGenerateText;
564
+ /**
565
+ * Creates an error, logs it, and throws it.
566
+ * @param message Error message to throw.
567
+ * @param logMessage Optional log message (defaults to message).
568
+ * @private
569
+ */
570
+ private throwAndLogError;
571
+ }
572
+ /**
573
+ * Draft mail message - extends MailMessage with X-Unsent header automatically set.
574
+ * Draft messages cannot be sent directly - they must be converted to regular messages first.
575
+ */
576
+ declare class DraftMailMessage extends MailMessage {
577
+ /**
578
+ * Creates a new draft mail message.
579
+ * The X-Unsent header is automatically set to '1' to mark this as a draft.
580
+ */
581
+ constructor();
582
+ }
583
+ /**
584
+ * Type alias for messages that can be sent via Mail.send().
585
+ */
586
+ type SendableMessage = MailMessage | EmailOptions;
587
+ /**
588
+ * Global email configuration that applies to all emails sent through a Mail instance.
589
+ */
590
+ interface MailGlobalConfig {
591
+ /**
592
+ * Default from address to use if not specified in the message.
593
+ */
594
+ from?: EmailAddress;
595
+ /**
596
+ * Global headers to add to all emails.
597
+ * These will be merged with message-specific headers, with message headers taking precedence.
598
+ */
599
+ headers?: EmailHeaders;
600
+ /**
601
+ * Default reply-to address to use if not specified in the message.
602
+ */
603
+ replyTo?: EmailAddress;
604
+ }
605
+ /**
606
+ * Mail class - instance-based email sending.
607
+ */
608
+ declare class Mail {
609
+ /**
610
+ * Extracts error messages from an error object.
611
+ * @param error Error object to extract messages from.
612
+ * @returns Array of error messages.
613
+ * @private
614
+ */
615
+ private static extractErrorMessages;
616
+ private provider;
617
+ private logger?;
618
+ private loggerInstance?;
619
+ private globalConfig?;
620
+ /**
621
+ * Creates a new Mail instance with a provider.
622
+ * @param provider The email provider instance.
623
+ */
624
+ constructor(provider: Provider);
625
+ /**
626
+ * Sets the logger instance for this mail instance.
627
+ * @param logger The logger instance (Console) to use for logging.
628
+ * @returns This instance for method chaining.
629
+ * @example
630
+ * ```ts
631
+ * const mail = createMail(provider);
632
+ * mail.setLogger(console);
633
+ * ```
634
+ */
635
+ setLogger(logger: Console): this;
636
+ /**
637
+ * Sets the default from address for all emails sent through this Mail instance.
638
+ * @param from Default from address to use if not specified in the message.
639
+ * @returns This instance for method chaining.
640
+ * @example
641
+ * ```ts
642
+ * const mail = createMail(provider);
643
+ * mail.setFrom({ email: "noreply@example.com", name: "My App" });
644
+ * ```
645
+ */
646
+ setFrom(from: EmailAddress): this;
647
+ /**
648
+ * Sets the default reply-to address for all emails sent through this Mail instance.
649
+ * @param replyTo Default reply-to address to use if not specified in the message.
650
+ * @returns This instance for method chaining.
651
+ * @example
652
+ * ```ts
653
+ * const mail = createMail(provider);
654
+ * mail.setReplyTo({ email: "support@example.com" });
655
+ * ```
656
+ */
657
+ setReplyTo(replyTo: EmailAddress): this;
658
+ /**
659
+ * Sets default headers for all emails sent through this Mail instance.
660
+ * These headers will be merged with message-specific headers, with message headers taking precedence.
661
+ * @param headers Default headers to add to all emails.
662
+ * @returns This instance for method chaining.
663
+ * @example
664
+ * ```ts
665
+ * const mail = createMail(provider);
666
+ * mail.setHeaders({ "X-App-Name": "MyApp", "X-Version": "1.0.0" });
667
+ * ```
668
+ */
669
+ setHeaders(headers: EmailHeaders): this;
670
+ /**
671
+ * Creates a draft email in EML (RFC 822) format without sending it.
672
+ * This is useful for previewing, saving for later, or testing email content.
673
+ * @param message The message to create a draft from (MailMessage or EmailOptions).
674
+ * @returns The email in EML (RFC 822) format as a string with X-Unsent: 1 header.
675
+ * @example
676
+ * ```ts
677
+ * // Create a draft from MailMessage
678
+ * const message = new MailMessage()
679
+ * .to("user@example.com")
680
+ * .from("sender@example.com")
681
+ * .subject("Hello")
682
+ * .html("<h1>Hello World</h1>");
683
+ *
684
+ * const eml = await mail.draft(message);
685
+ * console.log("Draft EML:", eml);
686
+ *
687
+ * // Save to file
688
+ * await fs.writeFile("draft.eml", eml);
689
+ *
690
+ * // Or send later by parsing the EML back to EmailOptions
691
+ * ```
692
+ */
693
+ draft(message: SendableMessage | DraftMailMessage): Promise<string>;
694
+ /**
695
+ * Sends an email message or email options.
696
+ * @param message The message to send (MailMessage or EmailOptions).
697
+ * @returns A result object containing the email result or error.
698
+ * @example
699
+ * ```ts
700
+ * // Using MailMessage
701
+ * const message = new MailMessage()
702
+ * .to("user@example.com")
703
+ * .from("sender@example.com")
704
+ * .subject("Hello")
705
+ * .html("<h1>Hello World</h1>");
706
+ * await mail.send(message);
707
+ *
708
+ * // Using EmailOptions
709
+ * await mail.send({
710
+ * to: "user@example.com",
711
+ * from: "sender@example.com",
712
+ * subject: "Hello",
713
+ * html: "<h1>Hello World</h1>"
714
+ * });
715
+ * ```
716
+ */
717
+ send(message: SendableMessage): Promise<Result<EmailResult>>;
718
+ /**
719
+ * Sends multiple messages using the email service.
720
+ * Returns an async iterable that yields receipts for each sent message.
721
+ * @example
722
+ * ```ts
723
+ * const messages = [
724
+ * { from: "sender@example.com", to: "user1@example.com", subject: "Hello 1", html: "<h1>Hello</h1>" },
725
+ * { from: "sender@example.com", to: "user2@example.com", subject: "Hello 2", html: "<h1>Hello</h1>" },
726
+ * ];
727
+ *
728
+ * for await (const receipt of mail.sendMany(messages)) {
729
+ * if (receipt.successful) {
730
+ * console.log("Sent:", receipt.messageId);
731
+ * } else {
732
+ * console.error("Failed:", receipt.errorMessages);
733
+ * }
734
+ * }
735
+ * ```
736
+ * @param messages An iterable of MailMessage instances or email options to send.
737
+ * @param options Optional parameters for sending.
738
+ * @param options.signal Abort signal to cancel the operation.
739
+ * @returns An async iterable that yields receipts for each sent message.
740
+ */
741
+ sendMany(messages: Iterable<SendableMessage> | AsyncIterable<SendableMessage>, options?: {
742
+ signal?: AbortSignal;
743
+ }): AsyncIterable<Receipt>;
744
+ /**
745
+ * Builds email options from a MailMessage instance for draft creation.
746
+ * Applies global configuration before building to ensure required fields are set.
747
+ * @param message The MailMessage or DraftMailMessage instance.
748
+ * @returns Built email options.
749
+ * @private
750
+ */
751
+ private buildDraftFromMessage;
752
+ /**
753
+ * Builds email options from EmailOptions for draft creation.
754
+ * @param options The EmailOptions object.
755
+ * @returns Email options.
756
+ * @private
757
+ */
758
+ private buildDraftFromOptions;
759
+ /**
760
+ * Applies global configuration to a MailMessage instance.
761
+ * @param message The MailMessage or DraftMailMessage instance.
762
+ * @private
763
+ */
764
+ private applyGlobalConfigToMessage;
765
+ /**
766
+ * Applies global configuration to email options.
767
+ * Global values are only applied if the corresponding field is not already set in the email options.
768
+ * @param emailOptions The email options to apply global configuration to.
769
+ * @returns Email options with global configuration applied.
770
+ * @private
771
+ */
772
+ private applyGlobalConfig;
773
+ }
774
+ /**
775
+ * Creates a new Mail instance with a provider.
776
+ * @param provider The email provider instance.
777
+ * @returns A new Mail instance.
778
+ * @example
779
+ * ```ts
780
+ * const mail = createMail(provider);
781
+ * mail.setFrom({ email: "noreply@example.com", name: "My App" });
782
+ * ```
783
+ */
784
+ declare const createMail: (provider: Provider) => Mail;
785
+ export { type Attachment, type AttachmentDataOptions, type AttachmentOptions, type CalendarEventOptions, type EmailAddress, EmailError, type EmailHeaders, type EmailOptions, type EmailResult, Mail, type MailGlobalConfig, MailMessage, type Priority, type Provider, type Receipt, RequiredOptionError, type Result, type SendableMessage, type TemplateRenderer, createMail, detectMimeType, generateContentId, readFileAsBuffer };