MAIL::MAIL 1g 2024-03-12 laplante@plcb.ca GOWEB/MAIL


title: “MAIL::MAIL” author: “laplante@plcb.ca” date: 2024-03-12 version: “1.0.2” section: “1g”

category: “GOWEB/MAIL”

Name

mail::mail — Send an email

Synopsis

mail::mail(from: string, to: string [, format: “goweb”, charset: string, ct: string, encoding: string, port: int, host: string, username: string, password: string, cc: string, bcc: string, message: string, subject: string, error: variable, content: array])

Description

The mail::mail function is used to send emails.
It supports plain text, HTML, attachments, and multipart content.

Parameters

content: [
  { charset: string, encoding: string, format: text|goweb, file: string|inline: string, ct: string },
  ...
]

This allows sending inline content, attachments, or multipart alternatives (e.g., plain text + HTML).

Examples

mail(
    from: "goweb@plcb.ca",
    host: "eris",
    password: "...",
    port: 587,
    to: "laplante@plcb.ca",
    subject: "Test with content Example été",
    ct: "text/html",
    cc: "laplante.p@gmail.com",
    encoding: "base64",
    message: "<div dir=\"ltr\"><b>TEST MAC éèçÉÈÇâ {{ datetime() }}</b></div>",
    format: "goweb",
    content: [
        { "message": "Content part inline1" },
        { "format": "goweb", "message": "Content part inline2 {{ datetime(); }}" },
        { "ct": "guess", "file": "moi.png" },
        [
          { "ct": "text/plain", "message": "Content multipart inline3" },
          { "ct": "text/html", "message": "<h1>Content multipart inline3</h1>" }
        ]
    ]
);

Author

laplante@plcb.ca

See also

Version