|
-
Mar 27th, 2011, 06:52 AM
#1
Thread Starter
Member
VB6 - EMail - JPEG IMAGE
Hi,
I want to send the picture box image embedded as body of email. So i converted it to Jpeg image and wrote HTML code for image. But the recipient is not getting the image embedded. Can anyone help me with this??
Here is my code:
Option Explicit
Private Sub Form_Load()
Picture1.AutoRedraw = True
Dim w As Double
Dim x As Double
Dim y As Double
Dim z As Double
Dim z1 As Double
w = 650
x = 301
y = 39
z = 109
z1 = 201
Dim xx As Double
Dim yy As Double
Dim zz As Double
Dim uu As Double
If w = 0 Then MsgBox "There are no records for" & DateTime.Date & "to be displayed"
If w > 0 Then
xx = (x * 100) / w
yy = xx + (y * 100) / w
zz = yy + (z * 100) / w
uu = zz + (z1 * 100) / w
Call DrawPiePiece(QBColor(1), 0.001, xx)
Call DrawPiePiece(QBColor(6), xx, yy)
Call DrawPiePiece(QBColor(3), yy, zz)
Call DrawPiePiece(QBColor(5), zz, uu)
End If
SavePicture Picture1.Image, "C:\TITAN\imagefile.jpeg"
Dim oApp As Outlook.Application
Dim oEmail As MailItem
Dim colAttach As Outlook.Attachments
Dim oAttach As Outlook.Attachment
Set oApp = CreateObject("Outlook.Application")
Set oEmail = oApp.CreateItem(olMailItem)
Set colAttach = oEmail.Attachments
With oEmail
.To = "[email protected]"
.Subject = "DAILY REPORT"
.BodyFormat = olFormatHTML
.HTMLBody = "<HTML><BODY><img src='cid:C:\TITAN\imagefile.jpeg'></img></BODY></HTML>"
.Save
.Display
.Send
End With
Set oEmail = Nothing
Set colAttach = Nothing
Set oAttach = Nothing
Set oApp = Nothing
End Sub
Public Sub DrawPiePiece(lColor As Long, ByVal fStart As Double, ByVal fEnd As Double)
Const PI As Double = 3.14159265359
Const CircleEnd As Double = -2 * PI
Dim dStart As Double
Dim dEnd As Double
Picture1.FillColor = lColor
Picture1.FillStyle = 0
dStart = fStart * (CircleEnd / 100)
dEnd = fEnd * (CircleEnd / 100)
Picture1.Circle (170, 150), 100, , dStart, dEnd
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|