Solved

JMail and images in body text

Posted on 2004-10-01
3
1,417 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 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

726 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