Het gaat om het volgende :
Ik ben bezig met een website waarin er de mogelijkheid is dat je, je paswoord vergeten bent er je kan kiezen om deze te laten opsturen via mail.
Dit lukt maar de layout is nog niet in orde en wil er een html document van maken met logo en dergelijke erbij van de firma maar het logo wordt niet getoond.
Waar moet ik juist beginnen zoeken om te weten waar hij vast hangt ? Of hoe het komt dat hij de foto niet weergeeft ?
Ik ben bezig met een website waarin er de mogelijkheid is dat je, je paswoord vergeten bent er je kan kiezen om deze te laten opsturen via mail.
Dit lukt maar de layout is nog niet in orde en wil er een html document van maken met logo en dergelijke erbij van de firma maar het logo wordt niet getoond.
Waar moet ik juist beginnen zoeken om te weten waar hij vast hangt ? Of hoe het komt dat hij de foto niet weergeeft ?
Code:
string htmlcontent = "<html>\r\n";
htmlcontent += "<head>\r\n";
htmlcontent += "\t<title>Usersettings @CarXP.be</title>\r\n";
htmlcontent += "\t<meta http-equiv=\"content-type\" content= \"application/xhtml+xml; charset=UTF-8\" />\r\n";
htmlcontent += "\t<style type=\"text/css\">\r\n";
htmlcontent += "\t</style>\r\n";
htmlcontent += "</head>\r\n";
htmlcontent += "<body>\r\n";
htmlcontent += "\t<table>\r\n";
htmlcontent += "\t\t<tr>\r\n";
htmlcontent += "\t\t\t<td><img src=\"cid:logocarxp\" alt=\"CarXP Logo\" /></td>\r\n";
htmlcontent += "\t\t</tr>\r\n";
htmlcontent += "\t\t<tr>\r\n";
htmlcontent += "\t\t\t<td>Good day " + g.Firma + ",</td>\r\n";
htmlcontent += "\t\t</tr>\r\n";
htmlcontent += "\t\t<tr>\r\n";
htmlcontent += "\t\t\t<td>\r\n";
htmlcontent += "\t\t\t\t<p>You have requested to receive your usersettings per email.</p>\r\n";
htmlcontent += "\t\t\t\t<p>You can log in into http://www.carxp.be using following settings:</p>\r\n";
htmlcontent += "\t\t\t</td>\r\n";
htmlcontent += "\t\t</tr>\r\n";
htmlcontent += "\t\t<tr>\r\n";
htmlcontent += "\t\t\t<td>\r\n";
htmlcontent += "\t\t\t\t<table>\r\n";
htmlcontent += "\t\t\t\t\t<tr>\r\n";
htmlcontent += "\t\t\t\t\t\t<td>Username : </td>\r\n";
htmlcontent += "\t\t\t\t\t\t<td>" + g.Gebruikersnaam + "</td>\r\n";
htmlcontent += "\t\t\t\t\t</tr>\r\n";
htmlcontent += "\t\t\t\t\t<tr>\r\n";
htmlcontent += "\t\t\t\t\t\t<td>Password : </td>\r\n";
htmlcontent += "\t\t\t\t\t\t<td>" + g.Wachtwoord + "</td>\r\n";
htmlcontent += "\t\t\t\t\t</tr>\r\n";
htmlcontent += "\t\t\t\t</table>\r\n";
htmlcontent += "\t\t\t</td>\r\n";
htmlcontent += "\t\t</tr>\r\n";
htmlcontent += "\t\t<tr><td><p>Sincerely,</p><p>CarXP</p></td></tr>\r\n";
htmlcontent += "\t</table>\r\n";
htmlcontent += "</body>\r\n";
htmlcontent += "</html>";
mm.Body = htmlcontent;
mm.IsBodyHtml = true;
mm.To.Add(new MailAddress(g.Email, g.Firma));
mm.Bcc.Add(mm.Sender);
mm.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure;
mm.Priority = MailPriority.High;
AlternateView htmlview = default(AlternateView);
htmlview = AlternateView.CreateAlternateViewFromString(htmlcontent, null, "text/html");
LinkedResource image = new LinkedResource("./images/logo.gif");
image.ContentId = "logocarxp";
image.TransferEncoding = System.Net.Mime.TransferEncoding.Base64;
htmlview.LinkedResources.Add(image);
mm.AlternateViews.Add(htmlview);
Laatst bewerkt: