How To Insert a pictue in mail

Hi All, I am sending a mail through lotus Script.

Now I want to insert a picture in the mail. Picture is in my image resource.

How I will Embedd a picture.

When User Will open the mail he will see the picture.

Any body have code?

Please guide me.

Subject: How To Insert a pictue in mail

Hi

On way of doing it would be by using MIME.

Take a look at the NotesMIMEEntity class

Use SetContentFromBytes to insert images in the mail.

regards

jesper Kiaer

http://www.jezzper.com

Subject: RE: How To Insert a pictue in mail

Hi, Thx for the response. Can U please give me one example. By Which I will implement the code.

Please. Thx in Advance

Pawan

Subject: RE: How To Insert a pictue in mail

Hi

As always there lots of usefull examples in the help database.

This is the example from there:

This agent creates a document in MIME format. The MIME content is one GIF file.

Sub Initialize

Dim s As New NotesSession

Dim db As NotesDatabase

Dim doc As NotesDocument

Dim body As NotesMIMEEntity

Dim stream As NotesStream

Set db = s.CurrentDatabase

s.ConvertMIME = False ’ Do not convert MIME to rich text

Set doc = db.CreateDocument

Call doc.ReplaceItemValue(“Form”, “Main Form”)

Set body = doc.CreateMIMEEntity

Set header = body.CreateHeader(“Subject”)

Call header.SetHeaderVal(“MIME image from GIF file”)

Set stream = s.CreateStream

If Not stream.Open(“c:\lotus\notes\data\folder.gif”, _

“binary”) Then

Messagebox "c:\lotus\notes\data\folder.gif",, _

"Open failed"

Goto ExitSub

End If

If stream.Bytes = 0 Then

Messagebox "c:\lotus\notes\data\folder.gif",, _

"File has no content"

Goto ExitSub

End If

Call body.SetContentFromBytes(stream, _

“image/gif”, ENC_IDENTITY_BINARY)

Call stream.Close

Call doc.Save(True, True)

ExitSub:

s.ConvertMIME = True ’ Restore conversion

End Sub

regards

Jesper Kiaer

http://www.jezzper.com