C# - HTML Email "opens" Not Being Tracked?
Oct 26, 2010
Let's say I wanted to show my StackOverflow "flair" badge in the signature of an email in Outlook. Obviously, I would want the image to be refreshed whenever I reply to an email or forward the email. Now, assuming the I (and others) have decided to allow images to be downloaded from me (who in this case we'll call a "trusted source") then they would see my flair badge refreshed on subsequent loads. If I copy and paste this badge into a new email then the image will not refresh on subsequent page loads because Outlook has embedded the image and severed the link to original image.
I completely understand everyone's comments about spam but this question is more about Outlook VML and manipulation of it. If the answer is always and forever "spam! Off with his head!" then that's fine. I get it but it seems to me that there may be situations where someone may not want the default behavior of Outlook to modify an email that it has already accepted.
Original Questions
We have an internal mail system that dynamically generates and sends HTML emails. We have a web beacon generated by an HTTP handler. The system works as expected: users recieve emails and we track opens as the web beacon is called.
The problem occurs when someone takes that same email that they just received (and we just tracked) and copies & pastes the content (including the web beacon) into a new email in Outlook. Outlook embeds all images instead of maintaining the URL back to the web beacon.
Is there a way to generate an image through an HTTP handler such that the src of the image is maintained when pasted in Outlook?
View 1 Replies
Similar Messages:
Mar 1, 2011
In my application i allow users to download a csv file from the App. When a user clicks on the Download file link , they see the Download file dialog box. My problem is that some o f the files opens as an HTML document.This happens intermittently.
Response.Clear();
Response.ClearContent();
Response.ClearHeaders();
Response.ContentType =
"application/octet-stream"
;
Response.AppendHeader(
"Content-Disposition",
"attachment;
filename="
+ sf.FileName);
Response.OutputStream.Write(sf.Data, 0, sf.Data.Length);
Response.Flush();
Response.Close();
I tried Response.End() insted of Response.Flush(); but didnt help.
View 1 Replies
Jun 1, 2010
I have the below script to get a Web Page's html and add it as a string to the mail.body property of the mail message that I have created. However, if the webpage is larger then several KBs, it cause a StackOverflowException to fire.
[Code]....
Is there a simple way to just tell the mail message to use a link like "a.com/default.aspx" for the mail message body?
View 4 Replies
Aug 6, 2010
i want to send a newsletter which stored in db(sql server 2005) containing image header,footer and content.i have created one html page which shows this data by using generic handler.when i m running this html page independently it is showing images properly.but when i m sending it with mail it doesn't show images.
View 5 Replies
Apr 19, 2010
I have a panel control whose background is an image. Using css, I have some variables inside that panel control. Now, if I want to email the panel control (with the background image and the text in them), how would i do that? Whenever I send an email, it misses all the styles and the background image as well.
Let me know if you need any more info.
View 8 Replies
Mar 10, 2011
I am sending email using NETWORK Credentials from Exchnage server. What i wanna do is to send email Format as HTML so that i will be able to Put some links etc in it. I am using below code to send email
[Code]....
View 2 Replies
Aug 2, 2010
I have an user control for users to input information, once the page is submitted, an email will be sent to web admin, the email body is supposed to look exactly the same as user control. Current I am using XSLT to generate email body, which is really difficult to maintain because everytime I made changes to user control I have to make the same changes to the XSLT. What is the best way to do this?
View 2 Replies
May 7, 2010
I would like to embed a picture into a html and send it in email. How can do so.
View 2 Replies
Jul 22, 2010
I am trying to implement a "send newsletter" process that works like this: -
1. The author develops a newsletter using Word.
2. When they are ready to distribute it, they save it as HTML, and upload this to the web site. It is then viewable with the appropriate URL.
3. They then distribute it with a web process that uses SendMail.
I have two problems: -
1. When you "Save as web page (*.htm, *.html)" from Word, the document is saved as .htm, and if there are any graphics within the document they are saved in a separate "*_files" folder. How do I upload this folder to the web site?
During testing I'm fudging this by uploading the folder with FTP, but of course this is not a viable solution for users.
2. I can send the email using alternate views, but the htmlview lacks the graphics. My logic reads the uploaded .htm document into a string variable called "HtmlBody", and then
code]....
This all works perfectly except that the email arrives just a graphic symbol and blank space where the graphic should be. How do I either send the graphics with the email, or (better) send it with references to the graphics back on the web page. The html
that I am sending out contains references to the graphics like <v:imagedata src="./FamNet%201%20July%202010_files/image001.jpg" o:title="NZSGFamNet"/>, which is looking in a subfolder from the folder containing the html. I suppose that if I could solve the first problem I could replace the "./" in the image reference to [URL]. This would not be too difficult, as I could recognize "FamNet%201%20July%202010" as the newsletter name and so look for the string"./" & NewsletterName & "_files". However somebody might be able to suggest a more elegant solution, provided that I can solve the first problem.
View 5 Replies
Aug 25, 2010
I want to send html emails with one promo-banner inside. Have a look at my code but with no success.
[Code]....
View 1 Replies
Apr 5, 2010
my application sends an email to a user. now the email body has a hyperlink, which shows as hyperlink to some recepients and as plain text to some other recepients. below is the code i used to send email from the application
[code]....
View 1 Replies
Jan 31, 2010
how to embed HTML tag while sending email using SmtpMail?I am using below code. Can anyone tell me where I went wrong?
MailMessage message = new MailMessage();
message.From = new MailAddress("sender@fgk.com");
message.To.Add(new MailAddress("receiver@fgk.com"));
message.Subject = "This is my subject";
message.Body = "This is the <b>content</b> <br /> <img alt=Logo src=../Images/logo.jpg align=left />";
message.IsBodyHtml = true;
View 5 Replies
Jun 2, 2010
I have a web form that a uses fills out and I want it to send the form in a email when the user clicks complete. I know how to send a HTML email in ASP.net but how do I get the HTML of the page so that I can send the completed form in a email.
View 4 Replies
May 14, 2010
Sending a DataTable's content in an html email, what is the preferred way to generate HTML from a DataTable?
View 3 Replies
Apr 6, 2010
Here is my code. What do I need to change to get the images referenced in the HTML to embed?
using
System;
using
System.Data;
using
System.Configuration;
using
System.Web;
using
System.Web.Security;
using
System.Web.UI;
using
System.Web.UI.WebControls;
using
System.Web.UI.WebControls.WebParts;
using
System.Web.UI.HtmlControls;
using
System.IO;
using
System.Net.Mail;
public
partial
class
SendEmail1 : System.Web.UI.Page
{
{
}
{
string FileNameToAttache;protected
void Page_Load(object sender,
EventArgs e)protected
void sendButton_Click(object sender,
EventArgs e)SmtpClient smtpClient =
new
SmtpClient();MailMessage message =
new
MailMessage();try
{
message.To.Add(toEmail);
}
MailAddress fromAddress =
new
MailAddress(fromTextBox.Text);string[] toEmails = toTextBox.Text.ToString().Split(';');foreach
(string toEmail
in toEmails) {//MailAddress toAddress = new MailAddress(toTextBox.Text);
message.From = fromAddress;
//message.To.Add(toAddress);
message.Subject = subjectTextBox.Text;
message.IsBodyHtml =
true;
/* Attaching Files Begin */
{
{
FileNameToAttache =
AttachFile1.PostedFile.SaveAs(Server.MapPath(FileNameToAttache));
message.Attachments.Add(
}
}
emailWithAttach.Host =
emailWithAttach.DeliveryMethod =
emailWithAttach.UseDefaultCredentials =
{
{
FileNameToAttache =
AttachFile1.PostedFile.SaveAs(Server.MapPath(FileNameToAttache));
message.Attachments.Add(
}
}
{
{
FileNameToAttache =
AttachFile1.PostedFile.SaveAs(Server.MapPath(FileNameToAttache));
message.Attachments.Add(
}
}
{
{
FileNameToAttache =
AttachFile1.PostedFile.SaveAs(Server.MapPath(FileNameToAttache));
message.Attachments.Add(
}
}
if (AttachFile1.PostedFile !=
null)HttpPostedFile attFile = AttachFile1.PostedFile;int
attachFileLength = attFile.ContentLength;if (attachFileLength > 0)Path.GetFileName(AttachFile1.PostedFile.FileName);new
Attachment(Server.MapPath(FileNameToAttache)));SmtpClient emailWithAttach
= new
SmtpClient();"Localhost";SmtpDeliveryMethod.Network;true;if
(AttachFile2.PostedFile != null)HttpPostedFile attFile = AttachFile2.PostedFile;int
attachFileLength = attFile.ContentLength;if (attachFileLength > 0)Path.GetFileName(AttachFile2.PostedFile.FileName);new
Attachment(Server.MapPath(FileNameToAttache)));if (AttachFile3.PostedFile
!= null)HttpPostedFile attFile = AttachFile3.PostedFile;int
attachFileLength = attFile.ContentLength;if (attachFileLength > 0)Path.GetFileName(AttachFile3.PostedFile.FileName);new
Attachment(Server.MapPath(FileNameToAttache)));if (AttachFile4.PostedFile
!= null)HttpPostedFile attFile = AttachFile4.PostedFile;int
attachFileLength = attFile.ContentLength;if (attachFileLength > 0)Path.GetFileName(AttachFile4.PostedFile.FileName);new
Attachment(Server.MapPath(FileNameToAttache)));
/* Attaching Files END */
message.Body =
smtpClient.Host =
smtpClient.Send(message);
resultLabel.Text =
}
{
resultLabel.Text =
}
}
{
}
}
"<html><head><title>" +
HttpUtility.HtmlEncode(subjectTextBox.Text) +"</title></head><body style='background-color:#edf8ff;'><div
style='width:600px;'><table width='600' align='center' style='background-color:#ffffff;'>" +
"<img src="[URL]/>" +"<tr><td colspan='2'style='width:500px;'><p>"
+ HttpUtility.HtmlEncode(greetingTextBox.Text) +
"</p></td></tr><br />" +"<tr><td colspan='2'style='width:500px;'><p>"
+ HttpUtility.HtmlEncode(createTextBox.Text) +
"</p></td><img src="[URL]" /></tr><br />" +"<tr><td
colspan='2'style='width:500px;'><p>" + HttpUtility.HtmlEncode(closingTextBox.Text) +
"</p></td></tr>" +"<tr><td><img src="[URL]"
/></td></tr>" +"</table></div></body><html>";"Localhost";"Email
sent! <br />";catch (Exception
ex)"Couldn't Send the Message!";protected
void clearButton_Click(object sender,
EventArgs e)
View 6 Replies
Jul 7, 2010
I am using vb.net to send an html styled table through email but no luck so far. The following is the code I used trying to give the table a border of 1
[Code]....
View 9 Replies
Oct 11, 2010
I have an email template in a file called template.html, how can i use it as mail body in asp.net?
View 1 Replies
Feb 9, 2010
I m trying to send an HTML formatted email. When I get the email I can see the links and <br> tags working but the bold, underline and italics aren't. This is what I used
Msg.BodyFormat = System.Web.Mail.MailFormat.Html
View 9 Replies
Nov 23, 2010
I want to read innerHtml/ innerText of a div to put in email. As div have differnet server side countrols in it. how I can read html from div ?
View 2 Replies
Mar 10, 2010
I'm a newbie to ASP.I am trying to create a webform to send a HTML newsletter to the visitors freinds.
I have created a loop (For i = 1 to 5) to include the recipients name (ToName1, ToName2, ...... ToName5) in the email
What is the syntax to use the varible ToName + i
View 3 Replies
Sep 24, 2010
want to send muliple html pages in a email in vb.net
View 1 Replies
Jan 20, 2010
Does anyone have a good tutorial or now how to send html emails. I have searched and searched and not been able to get anything to work. I have tried CDOSYS and havent been able to get it to work. Currently I am using System.Net.Mail and System.Text so that I can use StringBuilder and put it in the body.
I would like to be able to build an aspx page and send it as the body in an auto generated email.
View 18 Replies
Nov 16, 2010
I would like to be able to render a view in ASP.NET MVC so that all css classes in the elements are rendered inline in the tags. The sole purpose of this is to have email clients recognise html, as I believe that style must be inline for it to be recognised in email messages.
Is there any facility in ASP.NET MVC (or ASP.NET) that allows this?
View 1 Replies
Apr 5, 2010
I want to create HTML templates to send my subscribers e-mail message. I put HTML tags into a text file and changed the required format items every time I want to send an e-mail with values from my database using string.format():
[Code]....
[Code]....
I think the application will be slower as string.format() searches for more format items.
View 2 Replies
Mar 24, 2010
I have an asp.net / C# page which takes a comment, and then emails that comment. Sometimes when the user enters "&" in the comment, the comment is being truncated. So for example if the comment is "test & test" the email only sends out "test ".
I have tried HttpUtility.HtmlEncode - but it looks like the issue is on the outlook side and not on the C# side.
View 2 Replies