problem including picture in email!

Discussion in 'ASP .Net' started by Jeff, Jun 6, 2009.

  1. Jeff

    Jeff Guest

    hi 3.5

    I having trouble include picte in a html email generated by my website. I
    mean this works locally on my computer and I'm testing using Outlook
    Express, but someone I know haves Outlook (not Express) and he doesn't get
    the pictures. I wonder what can cause this? is it because fo wrong URL to
    the picture? is it constraints inside outlook?

    ******** markup of the troubling image tag ********
    <asp:Image ID="thumbnail" runat="server" Width="177" Height="130" />

    ******** code that sets the ImageUrl propertyl ********
    string url = Request.Url.ToString();
    url = url.Substring(0, url.IndexOf(Request.ApplicationPath));
    url += Request.ApplicationPath;
    url += "/Images/ImageThumbnail.aspx?id=" + id.ToString();
    thumbnail.ImageUrl = url;

    ******** code that sends the email ********
    MailMessage msg = new MailMessage(from, recipient);
    msg.Subject = "helloworld";
    HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(url);
    WebResponse res = req.GetResponse();
    StreamReader sr = new StreamReader(res.GetResponseStream());
    msg.Body = sr.ReadToEnd();
    msg.IsBodyHtml = true;
    SmtpClient client = new SmtpClient();

    any ideas?
    Jeff, Jun 6, 2009
    1. Advertisements

  2. Jeff

    Jeff Guest

    fixed, the problem was wrong url in navigateurl
    Jeff, Jun 6, 2009
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.