...
Tawesoft Logo

Source file src/tawesoft.co.uk/go/legacy/email/doc.go

Documentation: src/tawesoft.co.uk/go/legacy/email/doc.go

     1  // tawesoft.co.uk/go/legacy/email
     2  // 
     3  // Copyright © 2020 Tawesoft Ltd <open-source@tawesoft.co.uk>
     4  // Copyright © 2020 Ben Golightly <ben@tawesoft.co.uk>
     5  // 
     6  // Permission is hereby granted, free of charge, to any person obtaining a copy
     7  // of this software and associated documentation files (the "Software"), to deal
     8  // in the Software without restriction,  including without limitation the rights
     9  // to use,  copy, modify,  merge,  publish, distribute, sublicense,  and/or sell
    10  // copies  of  the  Software,  and  to  permit persons  to whom  the Software is
    11  // furnished to do so, subject to the following conditions:
    12  // 
    13  // The above copyright notice and this permission notice shall be included in all
    14  // copies or substantial portions of the Software.
    15  // 
    16  // THE SOFTWARE IS PROVIDED  "AS IS",  WITHOUT WARRANTY OF ANY KIND,  EXPRESS OR
    17  // IMPLIED,  INCLUDING  BUT  NOT LIMITED TO THE WARRANTIES  OF  MERCHANTABILITY,
    18  // FITNESS FOR A PARTICULAR PURPOSE  AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
    19  // AUTHORS  OR COPYRIGHT HOLDERS  BE LIABLE  FOR ANY  CLAIM,  DAMAGES  OR  OTHER
    20  // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    21  // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
    22  // SOFTWARE.
    23  
    24  // Package email implements the formatting of multipart RFC 2045 e-mail messages,
    25  // including headers, attachments, HTML email, and plain text.
    26  // 
    27  // File attachments are lazy, and read from disk only at the time the e-mail is
    28  // sent.
    29  // 
    30  // Package Stability
    31  // 
    32  // It is likely that this package will change at some point as follows:
    33  // 
    34  // * A Message-ID header will no longer be implicitly generated for a Message.
    35  // 
    36  // * The Envelope struct will no longer have a message field - instead, use
    37  // an (Envelope, Message) 2-tuple where you need both of these items.
    38  // 
    39  // This is a breaking change. As such, when this happens, the old behaviour will
    40  // be made available at tawesoft.co.uk/go/legacy/email.
    41  // 
    42  // Example
    43  // 
    44  // This example demonstrates formatting an email message and printing it to a
    45  // Writer (here, `os.Stdout`).
    46  // 
    47  //     package main
    48  // 
    49  //     import (
    50  //         "net/mail"
    51  //         "os"
    52  // 
    53  //         "tawesoft.co.uk/go/email"
    54  //     )
    55  // 
    56  //     func main() {
    57  //         var eml = email.Message{
    58  //             From:  mail.Address{"Alan Turing", "turing.alan@example.org"},
    59  //             To:  []mail.Address{{"Grace Hopper", "amazing.grace@example.net"}},
    60  //             Bcc: []mail.Address{{"BCC1", "bcc1@example.net"}, {"BCC2", "bbc2@example.net"}},
    61  //             Subject: "Computer Science is Cool! ❤",
    62  //             Text: `This is a test email!`,
    63  //             Html: `<!DOCTYPE html><html lang="en"><body><p>This is a test email!</p></body></html>`,
    64  //             Attachments: []*email.Attachment{
    65  //                 email.FileAttachment("Entscheidungsproblem.pdf"),
    66  //                 email.FileAttachment("funny-cat-meme.png"),
    67  //             },
    68  //             Headers: mail.Header{
    69  //                 "X-Category": []string{"newsletter", "marketing"},
    70  //             },
    71  //         }
    72  // 
    73  //         var err = eml.Print(os.Stdout)
    74  //         if err != nil { panic(err) }
    75  //     }
    76  //
    77  // Package Information
    78  //
    79  // License: MIT (see LICENSE.txt)
    80  //
    81  // Stable: no
    82  //
    83  // For more information, documentation, source code, examples, support, links,
    84  // etc. please see https://www.tawesoft.co.uk/go and 
    85  // https://www.tawesoft.co.uk/go/legacy/email
    86  package email // import "tawesoft.co.uk/go/legacy/email"
    87  
    88  // Code generated by internal. DO NOT EDIT.
    89  // Instead, edit DESC.txt and run mkdocs.sh.

View as plain text