I try create an SMTP sender in Go. This is part of code:
client, err := smtp.NewClient(remote, smtpServer.Host)
if err != nil {
return err
}
defer client.Close()
auth := SmtpLoginAuth(smtpServer.Username, smtpServer.Password)
authErr := client.Auth(auth)
if authErr != nil {
fmt.Println("login error", authErr)
return authErr
}
client.Mail(data.From())
client.Rcpt(data.To())
bodyWriter, err := client.Data()
if err != nil {
fmt.Println("body error", err)
return err
}
My problem is: I want to change hello message for server, in this moment my app send from localhost, i want to send DNS domain of my server but I don't know how I can do this in go.
example place where I want to change localhost string : https://jmp.sh/sugc8Ax