New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

github.com/cmarkh/SMTP

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/cmarkh/SMTP

  • v0.0.0-20200914192226-a8e93450edfe
  • Source
  • Go
  • Socket score

Version published
Created
Source

Mail 【golang send mail package】

 Mail: send mail support AUTH:

  • LOGIN : mail.LoginAuth(email.Username, email.Password)
  • CRAM-MD5: smtp.CRAMMD5Auth(email.Username, email.Password)
  • PLAIN : smtp.PlainAuth(email.Identity, email.Username, email.Password, email.Host)
  • NTLM: mail.NTLMAuth(email.Host, email.Username, email.Password, mail.NTLMVersion1) # mail.NTLMVersion2 也支持

Mail: send mail support Secure:

  • SSL
  • TLS
  • 非安全加密

Mail: Use github.com/farmerx/mail

email := NewEMail(`{"port":25}`)
email.From = `farmerx@163.com`
email.Host = `smtp.163.com`
email.Port = int(25) // [587 NTLM AUTH] [465,994]
email.Username = `Farmerx`
email.Secure = `` // SSL,TSL
email.Password = `************`
authType := `LOGIN`
switch authType {
case ``:
	email.Auth = nil
case `LOGIN`:
	email.Auth = LoginAuth(email.Username, email.Password)
case `CRAM-MD5`:
	email.Auth = smtp.CRAMMD5Auth(email.Username, email.Password)
case `PLAIN`:
	email.Auth = smtp.PlainAuth(email.Identity, email.Username, email.Password, email.Host)
case `NTLM`:
	email.Auth = NTLMAuth(email.Host, email.Username, email.Password, NTLMVersion1)
default:
	email.Auth = smtp.PlainAuth(email.Identity, email.Username, email.Password, email.Host)
}

email.To = []string{`farmerx@163.com`}
email.Subject = `send mail success`
email.Text = "尊敬的用户:\r\n   您好,附件中是您订阅的报表,请注意查收。"
//email.AttachFile(reportFile)
if err := email.Send(); err != nil {
      fmt.Println(err)
}

回首向来潇洒处, 归去. 也无风雨也无晴

 

FAQs

Package last updated on 14 Sep 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc