Solved

JMail and images in body text

Posted on 2004-10-01
3
1,364 Views
Last Modified: 2008-01-09
Hello,

I have some code which allows a user to generate an email.  All they need to do is enter an email address.  I would supply the body text.  The body text involves an image, which is also stored on the server.

The problem, though, is that after the email is sent, the image is an 'X' in the email (ie, not included)

Am I supposed to embed the image somehow into the email?

NOTES:
- I'm using JMail
- I'm using HTMLBody, for the body (thus allowing me to bold and what-not)

Any help would be appreciated
0
Comment
Question by:Sebastion
3 Comments
 
LVL 3

Expert Comment

by:onskee
ID: 12206329
Maybe you could paste the body of the email here?  My first 2 thoughts:
You're message body doesn't properly reference the path to the image.. Since (from what I can tell), you're sending an HTML formatted email, by the time the email gets to your recipient, it has no idea what web server it needs to look at.. So your img tag needs to look something like <img src="http://www.yoursite.com/images/yourimg.gif">
ie: it needs to be the full path to your site and the image.
Secondly, could it be that your email client blocks images? For example - Windows XP SP2 by default blocks embedded images in Outlook Express and displays their placeholders with the red X.

HTH
0
 
LVL 7

Accepted Solution

by:
j2nku earned 70 total points
ID: 12208751
Hello Sebastion,

Have you heard of inline attachments?
You have to attach the image files with Jmail as inline attachments (see w3jmail.pdf for info) and you can get the attachment CID with
Dim att1CID
att1CID = Message.AddAttachment("images/myimage1.gif", true) '// true indicates that it is INLINE attachment

and then you just do:

Message.appendHTML "<img src=""cid:" & att1CID & """>"

This should display the image in message and also include it as hidden attachment.
0
 

Author Comment

by:Sebastion
ID: 12209668
onskee:
I never thought of trying that, but it wasn't quite what I was looking for.  The image which will be embedded ino the emails might not be on the server all the time.  Thanks for the response though.


j2nku:
Thats exactly what I was looking for, thanks alot.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now