I wrote code in the language in C # where I send an email and within the email I embed HTML. In the same HTML I also inserted an image tag> IMG> whose SRC reaches the address on my site so that I can know if the customer has opened the email. The problem is that when I enter an email nothing happens and it does not turn to my site. When I entered F12 and tried to see the HTML I see that Google will link something to my SRC and that is why it is unable to contact my site. Anyone have an idea why this is happening?
This is what I wrote in the code:
And this is what Google presents: <Img src = "https://ci4.googleusercontent.com/proxy/2ytcmZNJQzRFSqY7JiKv8s6fOdHVrFKCWa9HCo31KqJn1Q6FMk7oAF-XMgvf2lOIqPROK-Kq4KarBbC4fKHRYiCDAQZsJF8=s0-d-e1-ft#http://localhost:61442/api/TrackActivity/openMail/43" width = " 1 "height =" 1 "class =" CToWUd ">
this is my code:
private string buildHTML(List<TextBox> textBoxes, string button1, string button2, string button3, int guid)
{
string HTML = "<!DOCTYPE html><html><head>";
HTML += "<style>.myButton {box-shadow:inset 0px 1px 0px 0px #ffffff;background:linear-gradient(to bottom, #ffffff 5%, #f6f6f6 100%);background-color:#ffffff;border-radius:6px;border:1px solid #dcdcdc;display:inline-block;cursor:pointer;color:#666666;font-family:Arial;font-size:15px;font-weight:bold;padding:6px 24px;text-decoration:none;text-shadow:0px 1px 0px #ffffff;}.myButton:hover {background:linear-gradient(to bottom, #f6f6f6 5%, #ffffff 100%);background-color:#f6f6f6;}.myButton:active {position:relative;top:1px;}</style>";
HTML += "</head><body>";
HTML += "<div><img src='http://localhost:61442/api/TrackActivity/openMail/" + guid + "' width='1' height='1' /></div>";
HTML += "<div>";
foreach (TextBox item in textBoxes)
{
HTML += "<p style='";
if (item.Bold ?? false)
{
HTML += "font-weight:bold;";
}
HTML += "font-size:" + item.FontSize + ";";
HTML += "color:" + item.Color + ";";
HTML += "'>"; ;
HTML += item.Text;
HTML += "</p>";
HTML += "</b>";
}
HTML += "</div>";
if (button1 != "" || button2 != "" || button3 != "")
{
HTML += "<div style='display:flex;justify-content:space-evenly'>";
if (button1 != "")
HTML += "<div><button type='button' class='myButton'><a href='http://localhost:61442/api/TrackActivity/ButtonClicked/" + guid + "/1'>" + button1 + "</a></button></div>";
if (button2 != "")
HTML += "<div><button type='button' class='myButton'><a href='http://localhost:61442/api/TrackActivity/ButtonClicked/" + guid + "/2'>" + button2 + "</a></button></div>";
if (button3 != "")
HTML += "<div><button type='button' class='myButton'><a href='http://localhost:61442/api/TrackActivity/ButtonClicked/" + guid + "/3'>" + button3 + "</a></button></div>";
HTML += "</div></body></html>";
}
return HTML;
}
why its happend?