Hello
how to Generate QR code dynamically and Send to mail Using C# Window Application
QRCodeGenerator qrGenerator = new QRCodeGenerator();
QRCodeGenerator.QRCode qrCode = qrGenerator.CreateQrCode(dtAccess.Rows[rows]["InvitationId"].ToString() + "_" + dtAccess.Rows[rows]["First_Name"].ToString() + "_" + dtAccess.Rows[rows]["Last_Name"].ToString() + "_" + dtAccess.Rows[rows]["Mobile"].ToString() + "_" + dtAccess.Rows[rows]["Email_1"].ToString(), QRCodeGenerator.ECCLevel.Q);
Bitmap qrCodeImage = qrCode.GetGraphic(20);
System.Web.UI.WebControls.Image imgBarCode = new System.Web.UI.WebControls.Image();
imgBarCode.Height = 120;
imgBarCode.Width = 120;
using (Bitmap bitMap = qrCode.GetGraphic(20))
{
using (MemoryStream ms = new MemoryStream())
{
bitMap.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
byte[] byteImage = ms.ToArray();
imgBarCode.ImageUrl = "data:image/png;base64," + Convert.ToBase64String(byteImage);
}
string imageContent = "
";
string body = "Hello {0},
QR Code For Event Name, At Address,Date,Time
" + imageContent + "
" + dtAccess.Rows[rows]["InvitationId"].ToString() + "
Thanks.";
QR Code For Event Name, At Address,Date,Time
" + imageContent + "
" + dtAccess.Rows[rows]["InvitationId"].ToString() + "
Thanks.";
MultipleRecipeintEmail(dtAccess.Rows[rows]["Email_1"].ToString(), "Invitation", body, imgBarCode.ImageUrl);
}
}
I am using this code mail send but image not display. Please Help!!


Rajeesh MenothRank #118 · 18.4K reputationPosted Sep 9, 2018, 9:29 PM EDT
Vivek KumarRank #272 · 9.3K reputationPosted Sep 9, 2018, 10:05 PM EDT
Hussam BarouqaRank #6,374 · 268 reputationPosted Nov 15, 2018, 5:13 AM EST
Yogesh GhorpadeRank #2,756 · 509 reputationPosted Sep 9, 2018, 10:03 PM EDT
Yogesh GhorpadeRank #2,756 · 509 reputationPosted Sep 9, 2018, 10:17 PM EDT