Re: VB6 - EMail - JPEG IMAGE
I don't think you can do that.
Because image in not part of your html file. It is just linked.
Options:
-chose other kind of file which allow embedding images like pdf, mht, cdr or else.
-send only a image (you can get text in image with same picture box too).
-send html+linked image as compressed archive so recipient can get your files situation. That can be done with some kind of archiver, zip, rar, 7z or manually.
I think so because I tryed this :)
Re: VB6 - EMail - JPEG IMAGE
Try this html code putting the correct width and height pixels for your image. No guarantees but worth a shot.
<img src="file:///C:\TITAN\imagefile.jpeg" width="270" height="39" style="border: 0pt none;margin:0pt 0pt 0pt 0pt;" title="imagefile.jpeg" alt="[image]" />
Re: VB6 - EMail - JPEG IMAGE
1. You are not saving the image as jpg. Using SavePicture will save it in bitmap format but with a jpeg extension. You need GDI+ or other DLLs to save to jpg format as VB can't do it by itself.
2. Are you getting any errors?
I think nime was right on and maybe Tom Moran's reply will fix it.
If not... I am guessing 4 things at the moment, either 1) the image was not saved correctly or 2) if outlook uses extensions to validate image then you may want to opt for jpg vs. jpeg, or 3) the image is not jpg format but bmp format with a jpeg extension & outlook may think it is an invalid image, 4) the image does not exist where you expected it
Also note that for testing you should probably be sending yourself emails vs. some recipient. This way you can make sure it works beforehand.
Edited: Not an outlook user myself for the most part. Does it have settings to not show images? The question I'm asking is, could the user's settings prevent the image from being shown?
And there is an example in the codebank section that you posted a reply too. Is that not working for you?
Re: VB6 - EMail - JPEG IMAGE
Ups, I see now "img src='cid:"...
I didn't know for that, but must try imediatelly!
Re: VB6 - EMail - JPEG IMAGE
Have you tried the original code? (http://www.vbforums.com/showpost.php...97&postcount=1)
How about testing with a regular jpg image file that is not created by code in order to isolate any image creation issues?
Re: VB6 - EMail - JPEG IMAGE
Hi all,
I checked the properties of the image saved and its showing "JPEG Image" only. I tried the code given in http://www.vbforums.com/showpost.php...97&postcount=1 also but it didnt work out. I dont follow where i am getting wrong
Re: VB6 - EMail - JPEG IMAGE
And its a bitmap image size wont be much less. The size of the image that is getting saved is 250kb. In outlook tools->options also mail format is in HTML only. Still i am not getting the code working
Re: VB6 - EMail - JPEG IMAGE
@LaVolpe: I am not getting any error. but i find some symbol in the body of email but nothing is loaded in recipient's mail :( And even the code in the link given didnt help me out with the problem. I am sending mail to another (different) mail id only. I find the image loaded in start->run-> C:\...\imagefile.jpeg and i tried saving it as bitmap and embedded also and even it didnt work out
Re: VB6 - EMail - JPEG IMAGE
And also i tried embedding a different image in my system(which is not generated out of code) but not worth
Re: VB6 - EMail - JPEG IMAGE
Guys thank you so much 2 each and every1 of u :) I got it done with this line of code
.HTMLBody = "<HTML><img src='C:\TITAN\imagefile.jpg' alt='' width=300 height=300></HTML>"
Re: VB6 - EMail - JPEG IMAGE
Quote:
Originally Posted by
gowriv89
Guys thank you so much 2 each and every1 of u :) I got it done with this line of code
.HTMLBody = "<HTML><img src='C:\TITAN\imagefile.jpg' alt='' width=300 height=300></HTML>"
Just noticed what you were doing wrong. You werent attaching the image before setting the htmlbody property.
Code:
Set colAttach = oEmail.Attachments
Set oAttach = colAttach.Add("D:\my documents\MyPic.jpg")
oEmail.Close olSave
Without it being actually attached, the "cid" tag wont work. ;)
Re: VB6 - EMail - JPEG IMAGE
@gowriv89 can you please post your working code here. i am tring to do the same but not able to achieve the result
Re: VB6 - EMail - JPEG IMAGE
can any help me please
vb Code:
Set colAttach = olMail.Attachments
Set oAttach = colAttach.Add("D:\wall papers\leaf.jpg")
i first attached the image then i am using below code buts its not showing image to receiver . it shows me the image in sent message but receiver is not able to see it
With olMail
vb Code:
.BodyFormat = olFormatHTML
.HTMLBody = "<HTML><img src='D:\wall papers\leaf.jpg' alt='' width=300 height=300></HTML>"