emailtemp

package module
v0.0.0-...-1aa4043 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 12, 2024 License: MIT Imports: 10 Imported by: 0

README

EasyEmailTemplate

To use this package put var Email github.com/David-Billingsley/EasyEmailTemplate
After this is in function you can call the functions by doing Email.Email_Body_Only()

This library is being developed to help make it easier to send emails using go.  
This libary is under devlopment if there is a send method you would like, please add it into the issue tracker.

Email_Body_Only

This function generates an email with body only using the email template file provided.

Parms: (Name - Data type - Definition)

  • Sender - String - Who is sending the email
  • Password - String - Senders Password
  • SmtpAdd - string - Senders email SMTP address
  • smtpHost - string - Senders email SMTP host
  • smtpPort - string - Senders email SMTP Port
  • templname - string - the .html template file to use for the email body.
  • receivers - []string - the list of receivers
  • subject - string - the subject of the email
  • bodytext - string - the text you would like passed to the body

Returns: String or Error

Example:

Email_W_Attachments

Send email with an attachment

Parms:

(Name - Data type - Definition)

  • Sender - String - Who is sending the email
  • Password - String - Senders Password
  • SmtpAdd - string - Senders email SMTP address
  • smtpHost - string - Senders email SMTP host
  • smtpPort - string - Senders email SMTP Port
  • receivers - []string - the list of receivers
  • subject - string - the subject of the email
  • bodytext - string - the text you would like passed to the body
  • attachmentPath - string - the path of the file you would like to attach

Returns: String or Error

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoginAuth

func LoginAuth(username, password string) smtp.Auth

Types

type Email

type Email struct {
	MaxFileSize      int
	AllowedFileTypes []string
}

func (*Email) Email_Body_Only

func (email *Email) Email_Body_Only(sender string, password string, smtpadd string, smtpHost string, smtpPort string, templname string, receivers []string, subject string, bodytext string) (string, error)

#region: Send Basic Email This function sends only basic templated emails using the html template provided

func (*Email) Email_W_Attachments

func (email *Email) Email_W_Attachments(sender string, password string, smtpadd string, smtpHost string, smtpPort string, receivers []string, subject string, bodytext string, attachmentPath string) (string, error)

#region: Send Email W Attach This function sends emails with attchments using the text sent. Warning not tested yet. Need to do thourgh testing

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL