()
| 11 | ) |
| 12 | |
| 13 | func generateMessageID() (string, error) { |
| 14 | split := strings.Split(SMTPFrom, "@") |
| 15 | if len(split) < 2 { |
| 16 | return "", fmt.Errorf("invalid SMTP account") |
| 17 | } |
| 18 | domain := strings.Split(SMTPFrom, "@")[1] |
| 19 | return fmt.Sprintf("<%d.%s@%s>", time.Now().UnixNano(), GetRandomString(12), domain), nil |
| 20 | } |
| 21 | |
| 22 | func SendEmail(subject string, receiver string, content string) error { |
| 23 | if SMTPFrom == "" { // for compatibility |
no test coverage detected