Solved

Send Formated html in lotus?

Posted on 2004-04-21
13
1,035 Views
Last Modified: 2013-12-18
I'd like to send a html code in lotus
I found the way to send my text but it's not interpreted as html, for example, if you execute

"mailto:?subject=My Test&body=<html><head><title>MyTitle</title> <meta http-equiv=" & Chr(34) & "Content-Type" & Chr(34) & " content=" & Chr(34) & "text/html; charset=iso-8859-1" & Chr(34) & "> <body bgcolor=" & Chr(34) & "#FFFFFF" & Chr(34) & "> <div align=" & Chr(34) & "center" & Chr(34) & "><b>size=" & Chr(34) & "7" & Chr(34) & ">HelloWorld</font></b></div></body></html>"

the code is in the body but as text not as htm
and it's seems that there's a limition in the number of characters (around 250)
Does anyome know a way to fix this problem? Many many thx
0
Comment
Question by:meciab
  • 4
  • 2
  • 2
  • +3
13 Comments
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 10875993
What version of Notes/Domino are you using?

If the text is in a form, mark that text and click on Text/Passthru HTML.
If the value is in a formula, enclose the whole lot in "[" and "]", Notes will pass the text through as HTML.
0
 
LVL 15

Expert Comment

by:Bozzie4
ID: 10876002
This method won't get your there !  Not in Lotus Notes, but not in any other messaging system ....  The 255 character limit is only 1 of the reasons (but a very important reason :-) )

You'll have to use a java or lotusscript agent to do it, one of the methods you can use is this (R6 only!)

http://searchdomino.techtarget.com/tip/1,289483,sid4_gci958913,00.html

Another method is to use the web task on the Domino server, to render the HTML mail and then use the document in the web.nsf database on the server to create a new memo :

http://www.eview.com/eview/viewr5.nsf/e640f630a3361f84852568f600070fd3/1a2e448f2316e11d85256d4b0069e875?OpenDocument&Highlight=2,html,mail

cheers,

Tom
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 10876011
"mailto:?subject='My Test'&body='<html><head><title>MyTitle</title> <meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\"> <body bgcolor=\"FFFFFF\"> <div align=\"center\"><b>size=\"7\">HelloWorld</font></b></div></body></html>'"
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Author Comment

by:meciab
ID: 10876055
I use lotus 6.5
Sorry I let the " & chr(34) & " instead of " cause I use vb to send this
0
 
LVL 19

Expert Comment

by:RanjeetRain
ID: 10876390
Sending HTML mails couldn't get any simpler. Check out this outstanding piece of code.

http://openntf.org/Projects/codebin/codebin.nsf/CodeSearch/4322A3203262705188256D5E0034329D

Download this library and get going instantly!!!

http://openntf.org/Projects/codebin/codebin.nsf/CodeSearch/4322A3203262705188256D5E0034329D/$file/SimpleMIME.lss

~ Ranjeet Rain
0
 

Author Comment

by:meciab
ID: 10876563
How to use it?
I want to use it via visual basic, do you know a way?
0
 
LVL 19

Expert Comment

by:RanjeetRain
ID: 10880702
With a bit of R&D you can EASILY do that. Do you expect readymade code?
0
 
LVL 3

Expert Comment

by:xp_commander
ID: 10885873
In your VB project, create a function which uses Domino COM interface , such as :-

Function sendHTMLemail()

Dim session As Object
Dim db As Object
Dim doc As Object
Dim rtitem As Object
Dim msg As String
Dim email As String

Set session = CreateObject("Notes.Notessession")
Set db = session.GETDATABASE("", "")
Call db.OPENMAIL
Set doc = db.CREATEDOCUMENT

doc.SendTo = "testing@testing.com"
doc.Subject = "Testing
doc.Form = "Memo"

Set rtitem = doc.CREATERICHTEXTITEM("Body")
Call rtitem.APPENDTEXT("<HTML>")  
Call rtitem.ADDNEWLINE(1)
Call rtitem.ADDNEWLINE("<HEAD>")
Call rtitem.ADDNEWLINE(1)
Call rtitem.APPENDTEXT("<TITLE>HTML Page</TITLE>")  
Call rtitem.ADDNEWLINE(1)
Call rtitem.ADDNEWLINE("</HEAD>")
Call rtitem.ADDNEWLINE(1)
Call rtitem.ADDNEWLINE("<BODY>")
Call rtitem.ADDNEWLINE(1)
Call rtitem.APPENDTEXT("Hello From HTML EMAIL")
Call rtitem.ADDNEWLINE(1)
Call rtitem.ADDNEWLINE("</BODY>")

Call doc.SEND(False)
Set session = Nothing

End Function
0
 

Author Comment

by:meciab
ID: 10886591
Your code send the mail directly, and th html code appear in text
I want to display an html in lotus "ready to send" (who allow to enter contact with lotus and do some modification if necessary)
0
 
LVL 15

Expert Comment

by:Bozzie4
ID: 10886941
You can combine the code in the examples with the COM interface coding , the biggest difference will be the session object, that has to be initialized as a Notes.notessession....

Tom
0
 

Author Comment

by:meciab
ID: 10888071
I found another way to display make it display in Lotus
but i can't find the way to display it as html, it's still displayed à text
(run send_click)


Option Explicit
'---------- API -----------
'pour faire passer au premier plan
Private Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd As Long) As Long
'pour ouvrir la fenetre
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
'pour verifier si la Lotus est ouvert
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
   
Dim sSrvr As String 'the mail server for the current user
Dim MailDbName As String 'THe current users notes mail database name
Dim UserName As String 'The current users notes name

Dim retval As Variant   'Holds return value for functions handle

'---------------- fonction ouverture de session Notes -----------
Function CreateNotesSession() As Boolean
    Const notesclass$ = "NOTES"
    Const SW_SHOWMAXIMIZED = 3 'plein ecran
    Const SW_SHOWMMINIZED = 2 'reduire
    Const SW_SHOWWINDOW = 1 'fenetre
    Const SW_SHOW = 5
   
    Dim Lotus_Session As Object
    Dim rc&
    Dim lotusWindow&
   
    lotusWindow = FindWindow(notesclass, vbNullString)

    Set Lotus_Session = CreateObject("Notes.NotesSession")
    sSrvr = Lotus_Session.GetEnvironmentString("MailServer", True)
    MailDbName = Lotus_Session.GetEnvironmentString("MailFile", True)
    UserName = Lotus_Session.UserName
   
    DoEvents
    'Ouverture de Lotus Notes
    retval = Shell("C:\Program Files\lotus\notes\notes.exe =h:\notes\notes.ini", vbMaximizedFocus)
   
    'verifier que Lotus est bien ouvert (recupere le handle)
    lotusWindow = FindWindow(notesclass, vbNullString)
    If lotusWindow <> 0 Then
        rc = ShowWindow(lotusWindow, SW_SHOW)
        rc = SetForegroundWindow(lotusWindow)
        CreateNotesSession = True
    Else
         CreateNotesSession = False
    End If
End Function

Sub CreateMailandAttachFileAdr(Optional IsSubject As String = "", Optional SendToAdr As String, Optional CCToAdr As String, Optional BCCToAdr As String = "", Optional Attach1 As String = "", Optional Attach2 As String = "", Optional body As String = "")
Const EMBED_ATTACHMENT As Integer = 1454
Const EMBED_OBJECT As Integer = 1453
Const EMBED_OBJECTLINK As Integer = 1452

Dim s As Object ' use back end classes to obtain mail database name
Dim db As Object '
Dim doc As Object ' front end document
Dim beDoc As Object ' back end document
Dim workspace As Object ' use front end classes to display to user
Dim bodypart As Object '
Dim bodyAtt As Object '
Dim lbsession As Boolean

lbsession = CreateNotesSession

If lbsession Then
    'cree la session Lotus Notes
    Set s = CreateObject("Notes.Notessession")
    'se connecte a sa database
    Set db = s.GetDatabase(sSrvr, MailDbName)
    If db.IsOpen = True Then
        'database deja ouvert
    Else
        Call db.Openmail
    End If
    'cree un document memo
    Set beDoc = db.CreateDocument
    beDoc.Form = "Memo"
   
    'construction du mail
    Set bodypart = beDoc.CreateRichTextItem("Body")
    'beDoc.From = "Moi" 'inutile
    beDoc.SendTo = SendToAdr
    beDoc.CopyTo = CCToAdr
    beDoc.BlindCopyTo = BCCToAdr
    beDoc.Subject = IsSubject
    '-----------------------------------------
    'Remarque si destinataire multiple il suffie de mettre un tableau d'e-mail dans SendTo (CopyTo,BlindCopyTo)
    'exemple :
    'Dim recip(25) as variant
    'recip(0) = "emailaddress1"
    'recip(1) = "emailaddress2" e.t.c
    'beDoc.sendto = recip
    '----------------------------------------
    ' documents joint 1
    If Len(Attach1) > 0 Then
        If Len(Dir(Attach1)) > 0 Then
             Set bodyAtt = bodypart.EmbedObject(EMBED_ATTACHMENT, "", Attach1, Dir(Attach1))
        End If
    End If

    ' documents joint 2
    If Len(Attach2) > 0 Then
        If Len(Dir(Attach2)) > 0 Then
            Call bodyAtt.EmbedObject(EMBED_ATTACHMENT, "", Attach2, Dir(Attach2))
        End If
    End If
       
    'Affichage du mail dans Lotus Notes
    Set workspace = CreateObject("Notes.NotesUIWorkspace")
    Call workspace.EditDocument(True, beDoc).FieldSetText("Body", body)

    Set s = Nothing
Else
    MsgBox "Lotus is close"
End If
End Sub
Private Sub Send_Click()
Dim html As String
html = "This <i>is</i> an <b>example</b><p>"
html = html + "<font color=purple>Wanna know where I work?</font><p>Click <a href=" & Chr(34) & "http://www.peopleware.be" & Chr(34) & ">here</a>"
    CreateMailandAttachFileAdr "Msujet", "Mto", "Mcc", "Mbcc", "c:\SNOVA.PLT", "c:\SNOVA2.PLT", html
End Sub


0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 11355934
Closed, 500 points refunded.

modulo
Community Support Moderator
Experts Exchange
0

Featured Post

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

831 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