How do I email an image with RenderControl

  • Thread starter Thread starter needin4mation
  • Start date Start date
N

needin4mation

Hi, I am using RenderControl to send the contents of my aspx DataGrid,
etc. from my form. In this form there is an image. The image resides
on the server. It has a url of ./mypic.jpg. Because of this when the
email is generated the picture is not shown in the resulting email
(just gives the x as ./isn't on their computer). Everything else is
fine because it is just html. But what if I want binary data like the
image? How can I get that and email it? Thanks for any guidance.
 
You have to use a fullly qualified URL for an image in an email. Search the
net for ASP.NET fully qualified URL. You're gonna want to do something with
the Request.ServerVariables["SERVER_NAME","SERVER_PORT", and/or
"SERVER_PORT_SECURE"]
 
The person receiving the email may not have access to the location. Is
there another way? GDI+?
 
the image is included in the mail body using Multipart/Related content
type, very simular to an attachement see the rfc:

ftp://ftp.ietf.org/rfc/rfc2387.txt

the exchange sdk supports this thru the AddReleatedBodyPart method.


-- bruce (sqlwork.com)
 

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

Back
Top