Solved

Lotus notes @mailsend as lotusscript

Posted on 2012-03-12
5
1,164 Views
Last Modified: 2013-12-18
I have a form with the following fields:-
Form Name: leasetracemail
ltto (text)
ltcc (text)
ltfbcc (text)
ltsubject (text)
ltbody (rich text)
trailer(text)

the rich text field can contain attachments and I am tryinmg to use the @mailsend as follows:
@MailSend(ltto;ltcc;ltbcc;ltsubject;"";ltbody:trailer);

However @mailsend does not work with rich text fileds for attachments.  I beleive that I need to use Lotusscript to do this but am not a Lotussscript programmer.  Can anyone translate the mailsend command (to use on a button) as Lotusscript please?

Thanks
Pete
0
Comment
Question by:peadarmac
  • 2
  • 2
5 Comments
 
LVL 46

Expert Comment

by:Sjef Bosman
Comment Utility
First, try to use

      @MailSend(ltto;ltcc;ltbcc;ltsubject;"";"ltbody":"trailer");

The 6th parameter is, according to the help: "The names of one or more fields from the current document that you want included in the mail memo. "
0
 

Author Comment

by:peadarmac
Comment Utility
Hi sjef_bosman,  the @mailsend works fine if the ltbody field is a simple text field.  The problem is if I make it a rich text field and attach a document it does not work.  Putting the sixth parameter in quotes just send ltbody as a literal string.  Really need to do this with script I reckon.  Thanks.
0
 
LVL 46

Expert Comment

by:Sjef Bosman
Comment Utility
I can confirm that the 6th parameter must be a text-list of field names. But if you say it doesn't work, I believe you ;-)

In LotusScript (assuming that the current document is opened AND is not a new document, i.e. it's been saved to disk):

Dim ws As New NotesUIWorkspace
Dim ns As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim maildoc As NotesDocument
Set db= ns.CurrentDatabase
Set doc= ws.CurrentDocument.Document
Set maildoc= New NotesDocument(db)
maildoc.Form= "Memo"
maildoc.SendTo= doc.ltto
maildoc.CopyTo= doc.ltcc
maildoc.BlindCopyTo= doc.ltbcc
maildoc.Subject= doc.ltsubject
Call doc.CopyItemToDocument(maildoc, "Body")
Call maildoc.Send(False)
0
 
LVL 4

Accepted Solution

by:
cohalex earned 500 total points
Comment Utility
You need to rename your fields on the form to:

ltto (text) -> SendTo (text (multivalue))
ltcc (text) -> CopyTo (text (multivalue))
ltfbcc (text) -> BlindCopyTo (text (multivalue))
ltsubject (text) -> Subject (text)
ltbody (rich text) -> Body (rich text)

If you cant simply rename them, create the new fields as computed and take the values from the original ones.
Body should be renamed though.

On your Send button in LS, you could have:

      Dim ws As New NotesUIWorkspace
      Dim uidoc As NotesUIDocument
      
      Set uidoc = ws.CurrentDocument
      Call uidoc.Send()
0
 

Author Closing Comment

by:peadarmac
Comment Utility
Exactly what I needed..simple and straightforward..Thx
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

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…
IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

728 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now