Go 1.11 has reached end of support
and will be deprecated
on January 31, 2026. After deprecation, you won't be able to deploy Go 1.11
applications, even if your organization previously used an organization policy to
re-enable deployments of legacy runtimes. Your existing Go
1.11 applications will continue to run and receive traffic after their
deprecation date. We
recommend that you migrate to the latest supported version of Go.
Package mail provides the means of sending email from an
App Engine application.
Example:
msg:=&mail.Message{Sender:"romeo@montague.com",To:[]string{"Juliet <juliet@capulet.org>"},Subject:"See you tonight",Body:"Don't forget our plans. Hark, 'til later.",}iferr:=mail.Send(c,msg);err!=nil{log.Errorf(c,"Alas, my user, the email failed to sendeth: %v",err)}
SendToAdmins sends an email message to the application's administrators.
Attachment
typeAttachmentstruct{// Name must be set to a valid file name.NamestringData[]byteContentIDstring}
An Attachment represents an email attachment.
Message
typeMessagestruct{// Sender must be set, and must be either an application admin// or the currently signed-in user.SenderstringReplyTostring// may be empty// At least one of these slices must have a non-zero length,// except when calling SendToAdmins.To,Cc,Bcc[]stringSubjectstring// At least one of Body or HTMLBody must be non-empty.BodystringHTMLBodystringAttachments[]Attachment// Extra mail headers.// See https://cloud.google.com/appengine/docs/standard/go/mail/// for permissible headers.Headersmail.Header}
A Message represents an email message.
Addresses may be of any form permitted by RFC 822.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-04 UTC."],[[["The `mail` package enables sending emails from within an App Engine application."],["The `Send` function is used to send email messages to specified recipients."],["The `SendToAdmins` function facilitates sending email messages to the application's administrators."],["The `Message` type defines the structure of an email, including sender, recipients, subject, body, and attachments."],["The `Attachment` type is used to define and add file attachments to email messages."]]],[]]