0

How can I make a button "Confirm Subscription" like in MailChimp?

My HTML code so far:

<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>

The above code was tested in 'https://developers.google.com/gmail/schemas/testing-your-schema' and works correctly.

But when I put that code in my c# website, the email does not send.

Can be some problem with SPF or DKIM ?

This is my code to send mail in 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);

Why does the email not send?

Eric Leschinski
  • 146,994
  • 96
  • 417
  • 335

1 Answers1

1

Try to enable SSL:

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

Hope this helps.

ProgramFOX
  • 6,131
  • 11
  • 45
  • 51