problem including picture in email!

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?
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top