Solved

JMail and images in body text

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Copy only dates 3 88
ASP Button to clear text 4 52
FileUp - Classic ASP 5 16
Writing lines of code from a form output in script within a results page 2 14
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…
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…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

815 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

8 Experts available now in Live!

Get 1:1 Help Now