c# - Tracking of send mail is read or not -
I have searched many articles and have received some code from me but this is not working for me
My index.aspx.cs page code
Secure zero page_load (Object Sender, EventArgs e) {if (checkIfRequested (this.Context.Request)) // // Receiver first The image is requested from, so do not send any modified results. Response.StatusCode = 304; Response.SuppressContent = True; } And {int emailId = 0; If ("String.IsNullOrEmpty" (Request.QueryString ["emailId"]) & amp; amp; Int.TryParse (Request.QueryString ["emailId"], Email ID out)) {Session ["Image"] = Request Email ID "]; Lblid.Text = Convert ToString (Session [" Image "]); // Email with email id has been opened, so log in that database} and {if (request .JQuery string [" Email id "] = zero) {lblid.Text = Convert.ToString (Request.QueryString [" emailId "]);} string str =" & lt; Script & gt; Warning ('empty') & lt; / Script> "; Page. Registry startupscript (" popup ", string);} Send single pixel gif image as response [] imgbytes = Convert.FromBase64String (" R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOW == "); Response.ContentType = "Image / gif"; Response.AppendHeader ("content-length", imgbytes.Length.ToString ()); Response.Cache.SetLastModified (DateTime.Now); Response.Cache.SetCacheability (HttpCacheability.Public); Response.BinaryWrite (Imgbytes);}} Private Bull Check Effected (HTText Requests) {// Check-Modified-Header to check whether the receiver has already 24 hours Returned requests are requested in the headers ["If-Modified-since"] == Empty? False: DateTime.Pres (Rick Headers ["If-Modified-Since"]) AddHours (24) & gt; DateTime.Now;}
My index.aspx page looks like
& lt; body & gt; form id = "form1" Runat = "server" & gt; & lt; asp: Label ID = "lblid" runat = "server" text = "" & gt; & lt; / asp: label & gt; & Lt; / Form & gt; & Lt; / Body & gt;
I wanted to send an email to my own Gmail ID from my aspx page like
string mailcontent = ""; Mailcontent + = "& lt; img src = 'http: //WWW.mywebsitename.com/index.aspx? Email id = 1' width = '1' height = '1' /> client = new SMtpClient (); Customer UseDefaultCredentials = false; client.Credentials = New System.Net.NetworkCredential ("Myemailidofhmail", "mypassword"); client.port = 25; client.host = "smtp.gmail.com"; client.EnableSsl = true; mailto = "Mitesh@gmail.com"; Message = MailContent.ToString (); msg = New System.Net.Mail.MailMessage (); msg.To.Add (Mail);
Here this mail has been successfully coming to my Gmail account on my mitesh@gmail.com
ID but when I open that mail from my account, I would like to call request.QueryString ["emailI D "]
value from 1 to index.aspx
Please see the answers to these questions:
Quote from the first question in answer:
mail client block too much All these types of efforts are the best idea to give them an image, so that they like to see if they read messages, and so they prefer to display images in their mail client.
Yes, this is very much the best advice, and still it can not work well that the email client is caching your images (though it's still the first download Should be able to log in). If someone reads your email then there is actually no easy way to confirm it, unless you can reach your website with a link in the email.
Comments
Post a Comment