0

如何像在 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# 网站时,电子邮件不会发送。

SPFor可能有问题DKIM

这是我在 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);

为什么邮件发不出去?

4

1 回答 1

1

尝试启用 SSL:

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

希望这可以帮助。

于 2013-07-27T08:20:42.850 回答