Senden von E-Mails aus Lotus Notes mit Excel und Anhaftung & HTML-Körper

Recht, ich bin versucht, senden Sie eine E-Mail-Formular eine excel-Tabelle, obwohl lotus notes, es hat eine Anlage, die der Körper benötigt, um in HTML.

Habe ich einige code, der von allen, die ich gelesen habe, sollte es mir ermöglichen, dies zu tun aber es funktioniert nicht.
Ohne den HTML-body der Anlage schicken, wenn ich impliment ein HTML-body der E-Mail immer noch sendet, aber die Anlage verschwindet, habe ich versucht, rearanging die Reihenfolge der code Ausschneiden der bits, die möglicherweise nicht benötigt werden, aber das ist alles invain.

(Sie verweisen müssen Lotus Domino-Objekte um diesen code auszuführen.
strEmail ist die E-Mail-Adressen
strAttach ist der string, Standort der Anlage
strSubject, ist das Thema text
strBody ist der body-text
)

Sub Send_Lotus_Email(strEmail, strAttach, strSubject, strBody)

Dim noSession As Object, noDatabase As Object, noDocument As Object
Dim obAttachment As Object, EmbedObject As Object

Const EMBED_ATTACHMENT As Long = 1454

Set noSession = CreateObject("Notes.NotesSession")
Set noDatabase = noSession.GETDATABASE("", "")

'If Lotus Notes is not open then open the mail-part of it.
If noDatabase.IsOpen = False Then noDatabase.OPENMAIL

'Create the e-mail and the attachment.
Set noDocument = noDatabase.CreateDocument
Set obAttachment = noDocument.CreateRichTextItem("strAttach")
Set EmbedObject = obAttachment.EmbedObject(EMBED_ATTACHMENT, "", strAttach)

'Add values to the created e-mail main properties.
With noDocument
    .Form = "Memo"
    .SendTo = strEmail
    '.Body = strBody ' Where to send the body if HTML body isn't used.
    .Subject = strSubject
    .SaveMessageOnSend = True
End With

noSession.ConvertMIME = False
Set Body = noDocument.CreateMIMEEntity("Body") ' MIMEEntity to support HTML
Set stream = noSession.CreateStream
Call stream.WriteText(strBody) ' Write the body text to the stream
Call Body.SetContentFromText(stream, "text/html;charset=iso-8859-1", ENC_IDENTITY_8BIT)
noSession.ConvertMIME = True

 'Send the e-mail.
With noDocument
    .PostedDate = Now()
    .Send 0, strEmail
End With

 'Release objects from the memory.
Set EmbedObject = Nothing
Set obAttachment = Nothing
Set noDocument = Nothing
Set noDatabase = Nothing
Set noSession = Nothing

End Sub

Wenn somone könnte mich in die richtige Richtung wäre ich sehr dankbar.

Bearbeiten:
Ich habe getan, ein wenig mehr untersucht und ich habe festgestellt, eine kuriosität, wenn ich schaue in den gesendet-Ordner die E-Mails, alle haben die Büroklammer-Symbol, mit einem Anhang, obwohl, wenn Sie gehen in der E-Mail auch in den gesendeten HTML-diejenigen, die nicht zeigen eine Anlage.

InformationsquelleAutor Anthony | 2010-03-23

Schreibe einen Kommentar