如何制作“;确认订阅”;gmail的按钮

本文关键字:gmail 按钮 何制作 确认 | 更新日期: 2023-09-27 18:25:04

如何像MailChimp中那样制作按钮"确认订阅"?

到目前为止我的HTML代码:

<div itemscope itemtype="http://schema.org/EmailMessage">
  <meta itemprop="description" content="Confirmacao de inscricao" />
    <div itemprop="action" itemscope itemtype="http://schema.org/ConfirmAction">
      <meta itemprop="name" content="Confirmar Agora" />
      <div itemprop="handler" 
           itemscope itemtype="http://schema.org/HttpActionHandler">
        <link itemprop="url" 
              href="http://beta.pegacupom.com.br/confirmnews.aspx?code=xyz" />
      </div>
    </div> 
</div>

上面的代码在https://developers.google.com/gmail/schemas/testing-your-schema'并且工作正常。

但当我把代码放在我的c#网站上时,电子邮件不会发送。

SPFDKIM可能有问题吗?

这是我用C#发送邮件的代码:

System.Net.Mail.MailMessage objMail = new System.Net.Mail.MailMessage();
objMail.From = new MailAddress("myemail@myDOMAIN.com", "myName");
objMail.To.Add(new MailAddress(emailTO));
objMail.Headers.Add("Content-Type", "text/html");
objMail.Body = mensagem;
objMail.IsBodyHtml = true;
objMail.SubjectEncoding = Encoding.GetEncoding("ISO-8859-1");
objMail.BodyEncoding = Encoding.GetEncoding("ISO-8859-1");
objMail.Subject = assunto;
SmtpClient objSMTP = new SmtpClient("smtp.myDOMAIN.com.br", 587);
System.Net.NetworkCredential objCredential = new System.Net.NetworkCredential("name@myDOMAIN.com.br", "myPASS");
objSMTP.Credentials = objCredential;
objSMTP.Send(objMail);

为什么电子邮件不发送?

如何制作“;确认订阅”;gmail的按钮

尝试启用SSL:

objSMTP.Credentials = objCredential;
objSMTP.EnableSsl = true; // add this line
objSMTP.Send(objMail);

希望这能有所帮助。