Notes ID:
PCSAdmin LSBSAdmin
Question: I have an agent of automate sending mail. Can we edit sender become other person not the person who signed an Agent?
Case:
- Currently, the agent is signed by [PCSAdmin]. So it will always send out by the person call "PCSAdmin"
- I want to change to another account[LSBSAdmin] send out the email, can we edit the script of sender? or must signed the agent with [LSBSAdmin]?
Lotus script
Dim maildoc As NotesDocument
Dim body As NotesMIMEEntity, header As NotesMIMEHeader, stream As NotesStream
Dim child As NotesMIMEEntity
Set stream = s.Createstream()
s.Convertmime = False
Set maildoc = db.Createdocument()
maildoc.Form = "Memo"
Set body = maildoc.Createmimeentity
Set header = body.Createheader("Subject")
Call header.Setheaderval("NOTIFICATION Email")
Set header = body.Createheader("To") ' Send to/to
Call header.Setheaderval("personname")
Set header = body.Createheader("CopyTo") ' Copy To/cc
Call header.Setheaderval("Personname")
Call stream.Writetext(|<html><body>|)
Call stream.Writetext(|<b>Dear | + lsdoc.Getitemvalue("Name")(0) + |,</b><br>|)
Call stream.Writetext(|<p>|+ "Attached herewith is the FORM for Application for Renewal of application <b>"+ sadoc.name(0)+|</b>.</p>|)
Call stream.Writetext(|<p>| + "Please complete the FORM and send by email to <b>"+MailAddress+"</b>" +_
", with the subject '<b>RENEWAL Application</b>'" + |</p>|)
Call stream.Writetext(|<p> Thank you </p>|)
Call stream.Writetext(|<p> </p>|)
Call stream.Writetext(|Secretary<br>|)
Call stream.Writetext(|Company<br>|)
Call stream.Writetext(|<em>(No signature is required on this computer generated document)</em><br>|)
Call stream.Writetext(|</body></html>|)
Set child = body.Createchildentity()
Call child.Setcontentfromtext(stream, "text/HTML;charset=iso-8859-1", ENC_NONE)
Call stream.Close()
Call stream.Truncate()
Set child = body.Createchildentity()
Set header = child.Createheader("Content-Type")
Call header.Setheaderval("multipart/mixed")
Set header = child.Createheader("Content-Disposition")
Call header.Setheaderval(|attachment; filename="| + xlfilename + |"|)
Set header = child.Createheader("Content-ID")
Call header.Setheaderval(|"| + xlfilename + |"|)
Set stream = s.Createstream()
If Not stream.Open(template, "binary") Then
Print "Unable to open " + template
End If
If stream.Bytes = 0 Then
Print template + " has no content"
End If
Call child.Setcontentfrombytes(stream, "application/vnd.ms-excel", ENC_IDENTITY_BINARY)
Call stream.Close()
Call stream.Truncate()
Call maildoc.Send(False)
Print "Email sent"
s.Convertmime = True