dptrmt4366 2019-01-22 19:53
浏览 86

如何解决网站发送的电子邮件中的可疑链接错误

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>&copy; 2019 companyName. All rights reserved.</p>
    <p>company addr</p>
    <P>company city</P>
    </div>
    </body>
    </html>
  • 写回答

1条回答 默认 最新

  • douti0687 2019-01-30 19:21
    关注

    Alright, I solved this problem. At first, I thought that might be G Suite problem, So I called them and I realized it's not because I could see our email in the inbox and not in the spam folder. So I tried this link and I request a review for our domain. After about 30 hours the problem was gone!

    评论

报告相同问题?

悬赏问题

  • ¥15 微信会员卡接入微信支付商户号收款
  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?