nikoksr/notify

How to use mail service

SecLoop opened this issue · 2 comments

How to use mail service

Demo

func Service() {
	// Create a telegram service. Ignoring error for demo simplicity.
	mailService := mail.New("xxxx@163.com", "smtp.163.com:465")
	mailService.AuthenticateSMTP("", "xxxx@163.com", "xxxxxx", "smtp.163.com")
	mailService.AddReceivers("xxxxx@163.com")
	notify.UseServices(mailService)
	// Send a test message.
	err := notify.Send(
		context.Background(),
		"Subject/Title",
		"The actual message - Hello, you awesome gophers! :)",
	)
	if err != nil {
		log.Println(err)
	}
}

image

Hey @SecLoop, I appreciate your efforts and contribution. With this one, I'm just not too sure how to handle it. Are you trying to provide an usage example for the email service, or, are you asking about how to use the service correctly? Please let me know, I'd like to help you out either way.

@nikoksr This problem has been solved when using mail service. Because of the problem of SMTP SSL. Use a non SSL port. At the same time, we also hope to support SSL port. Thank you.