1. This website uses cookies to improve service and provide a tailored user experience. By using this site, you agree to this use. See our Cookie Policy.
    Dismiss Notice

ASP.NET, How to update image in already sent email?

Discussion in 'C, C++, C#' started by loginname, Sep 19, 2009.

  1. loginname

    loginname Regular Member

    Oct 1, 2008
    Likes Received:

    ASP.NET 3.5

    I'm looking for ways to update images in already sent emails.
    I'm creating an email with an image which I host from my webserver. After the email is sent I update the image, then when I view the email again I see the old image.

    The reason for this is AFAIK caching.

    I came across this article: http://dotnetguts.blogspot.com/2009/05/how-to-remove-image-from-cache-when.html

    Which I have this example:
    "~/Image/User5.jpg?" + DateTime.Now.ToString("ddyyhhmmss")
    But that example will not work for me, as that example contains ASP.NET, I'm instead looking for regular ways to solve it without using DateTime.Now in the tag.

    any ideas?
  2. dparker

    dparker Newbie

    Feb 7, 2009
    Likes Received:
    Software enginner
    You dont have to use DateTime.Now in the urls. You can simply use a number or letter in the tag.


    If you want to update the image and ensure you users always have the latest version instead of a cached image, just change number on the url of the image.


    Browsers and AFAIK cache based on the url.


    is a different url then


    I hope you get the idea.

    But your situation here is a bit different here. AFAIK is a caching service and not a browser. Since you have already sent the email with the url embeded in the email, and AFAIK has already cached it, in my opinion you are SOL in terms of getting the new image to your users through the email. Option 1 is to ask AFAIK to remove the image from their caches, this might just work. Option 2 is to resend the email, since you have already sent it, most users have propably already read it, so sending it again, with the corrected image is a good option.