problem including picture in email!

  • Thread starter Thread starter Jeff
  • Start date Start date
J

Jeff

hi

asp.net 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;
sr.Close();
res.Close();
SmtpClient client = new SmtpClient();
client.Send(msg);
msg.Dispose();

any ideas?
 
Back
Top