Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

JMail and images in body text

Posted on 2004-10-01
3
Medium Priority
?
1,429 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
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…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

618 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