I am trying to make a bot which sends mails. I got the following code. I am wondering, if it's possible to place the mails
slice into this field seperated by a ,
?
&bcc=
If my test.txt contains
[email protected]
[email protected]
I'd like the part of the link to contain &[email protected],[email protected]
Is this doable with Go?
package main
import (
"bufio"
"fmt"
"log"
"os"
"os/exec"
)
func main() {
file, err := os.Open("test.txt")
if err != nil {
log.Fatal(err)
}
var mails []string
scanner := bufio.NewScanner(file)
for scanner.Scan() {
mails = append(mails, scanner.Text())
}
fmt.Println(mails)
exec.Command("xdg-open", "https://mail.google.com/mail/u/0/?fs=1&tf=cm&[email protected],&[email protected],[email protected]&su=Hello+World!&body=This+Is+Just+An+Example").Run()
}