?
Solved

JMail and images in body text

Posted on 2004-10-01
3
Medium Priority
?
1,423 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 280 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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 informatio…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

800 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