Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I include graphics on emailed pages? 1

Status
Not open for further replies.

RandyBlackburn

Programmer
Oct 1, 2002
153
US
I've got an aspx page that I want users to be able to email. When I try it, it has placeholders for the graphics. How can I best do this? I don't think I can send a link, since the web server is not public.

Randy
 
Randy - haven't checked these out but if you haven't seen them might be something there:





..of course you could always put your images in a safe public place, like tinypic.com, and grab it from there (of course that wouldn't work on a day to day basis but it might work once in a great while). It'll be interesting to see how this plays out.
 
Thanks guys,


Isadore -- I may have to fall back on server-based email, as you suggest.

ca8asm -- Unfortunately, I'm using VS 1.1. The writeup says it won't work for 1.1.

I've found that saving the page as a .mht file via the browser preserves everything. Can it be saved on the server by asp? How might I attach it to a a client-based email without the user doing it manually?
 
You could save the response stream out to a file (with a mht extension) with a StreamWriter, however, I'm not too sure how easy it would then be to send that file as an email (you could certainly read it's contents but I'm just not convinced that you'll be able to trick the email into thinking that the contents are just image text).


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
You could also try some 3rd party components such as which seem to allow embedded images (there is an example of an "inline image" which I'm assuming is the same thing). I've never tried it but it may be worth a go if you're stuck using version 1.1 of the framework.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.
 
I'll look into it. Thanks. It appears to be a server-based email system? Any input on how to save an .mht file on the server, then call it up as an attachment to a client-based email like outlook?
 
Emails are MIME formatted documents. That means that you can create the email, and create references to embedded objects that are base64 encoded (the whole thing is 7-bit text). Essentially this is all MHT files are, except they do have some Microsoft proprietariness to them.

I don't have an example of this, but if you were to use your email client to embed an image and send yourself a copy you could check the resulting email for sample syntax.

One warning is that Outlook changes the format of the message to its own format. You would do better to use a POP3 client (I think Outlook Express works), or telnet into a POP3 server to retrieve the raw mail as text.

Here are some of the related RFCs:

Here is some documentation on POP3 commands, in case you want to telnet into a POP3 server:
 
That was a lot more in depth that I would have been able to answer [smile]


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
I've found this website ( to be particularly helpful when dealing with emailing in ASP.NET.

Particularly, although it is for 2.0 only, unfortunately.

The only problem that I've come across in using this technique to embed images is that webmail based clients (hotmail, gmail, etc.) do not seem to handle the image the same way as a regular email client (like Outlook). Usually, the webmail apps will end up with the image as an attachment, instead of inline, or inline and an attachment.

Anybody know how to get around that?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top