Solved

Lotus notes @mailsend as lotusscript

Posted on 2012-03-12
5
1,171 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
ID: 37712551
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
ID: 37713546
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
ID: 37713593
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
ID: 37713613
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
ID: 37716473
Exactly what I needed..simple and straightforward..Thx
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

816 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

8 Experts available now in Live!

Get 1:1 Help Now