I'm sending a reset password email from my Go RESTFUL web service to our users and I'm using Go SMTP and google Gsuite domain which info@mycompanyname.ca! I've tested it before and it works but when I send it to one of our users he gets Suspicious Link error. He's using the Gmail website. I checked the https and both my website and links are https and When he forwards the email to me I don't see this error anymore! Can anybody help me with this?
This is my code :
mime string = "MIME-version: 1.0;
Content-Type: text/html;
charset=\"UTF-8\";
"
hostname string = "smtp.gmail.com"
auth := smtp.PlainAuth("", username, password, hostname)
data := map[string]string{"Token": token}
buffer := new(bytes.Buffer)
t, err := template.ParseFiles(htmlFilename)
if err != nil {
return err
}
err = t.Execute(buffer, data)
if err != nil {
return err
}
msg := []byte(subject + mime + buffer.String())
reciever = append(reciever, clientMail)
return smtp.SendMail(hostname+":587", auth, "", reciever, msg)
}
And this is HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1, maximum-scale=1.0, shrink-to-fit=no" name="viewport">
<meta name="author" content="some name">
<meta name="description" content="Entry HTML page for the dashboard">
</head>
<body style="max-width: 50rem; margin: auto; margin-top: 1rem;">
<img src="https://address in google drive" style="margin:auto;
display: block; width: 17rem; height: 4.6rem; position: relative; left: 50%; transform: translateX(-50%);"
alt="logo" title="company logo" />
<div style="margin-top: 0.5rem; padding-left: 0.5rem; padding-right: 0.5rem; border-top: 1px solid lightgray;
border-bottom: 1px solid lightgray; background-color: #f9f9f9">
<h3>Hello!</h3>
<p>You receive this email because this is your first time logging in. To enter your account,
you will need to set a password. Click the button below to set it.</p>
<div style="text-align: center">
<a href="https://websiteAddress/#/changepasswordapi?token={{ .Token }}" target="_blank">
<button style="cursor: pointer; border: none; width: 50%; background-color: #ED5E28;
color: white; font-size: 1rem; height: 2.5rem;
border-radius: 0.35rem"><strong>Set Password</strong></button>
</a>
</div>
<p>If you didn't request this, please ignore this email. The password setup is only valid for the next 24 hours.</p>
<p>Thanks,</p>
<p>compaynName Team</p>
</div>
<div style="text-align: center; font-size: 0.8rem; color: gray">
<p>© 2019 companyName. All rights reserved.</p>
<p>company addr</p>
<P>company city</P>
</div>
</body>
</html>