Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Lotus Notes email automation...

Status
Not open for further replies.

Neil Toulouse

Programmer
Mar 18, 2002
882
GB
Hi folks!

Propably posting this in the wrong place but it's a start!

Basically I have found some code over at the wiki for automating Lotus Notes for sending email. All works great, except I need to change the 'From' email address, but cannot find a way to do it (or should I say the correct 'ReplaceItemValue' command/value). My Googling has not turned up anything.

Does anyone have any experience of this model and can shed any light?

I like work. It fascinates me. I can sit and look at it for hours...
 
If you mean when talking about "the wiki", then why not reference it?

ReplaceItemValue() is not helping you here, go up to the beginning of the wiki article. It says "Assumes that it is sitting on a record to be processed for sending mail." and it lists cUser as one of the fields of such a record (being the input parameter so to say).

In Lotus Notes as in any other Mail program, the profile or database you use determines the sender, that may be overridden, eg in outlook you at least can set a returnto adress differeing from the sender. In low level SMTP it's easy to fake any sender mail adress, but while in systems like Outlook or Lotus Notes, their profile, eg a .pst file (outlook) or .nsf file (Lotus Notes) is where the mail is put into the sent items and where the sender mail comes from.

cUSer is used in two alternative programs:
Code:
oSpace = CreateObject("Notes.NotesUIWorkspace")

oSpace.OpenDatabase( TRIM(message.cDomain), TRIM(message.cUser) )
oDocument = oSpace.ComposeDocument(,,"Memo")
... continue working on the oDocument mail object

or

Code:
loSession = createobject("Notes.NotesSession")

*-- .GetDatabase creates a NotesDatabase object that represents the
*-- database located at the server and file name you specify, and opens
*-- the database, if possible.

loDB = loSession.GetDatabase(trim(message.cDomain), trim(message.cUser))

if loDB.isOpen()
   *-- .CreateDocument() creates a document in a database and returns a
   *-- NotesDocument object that represents the new document.

   loMail = loDB.CreateDocument()
   ... continue working on the loMail mail object
endif

Once you're there at oDocument or loMail, which I assume are the same kind of object, you can continue using any other code setting the mail objects properties.

So what you need instead of a sender mail adress is the path to the users Notes database .nsf file.

Bye, Olaf.
 
Hi Olaf!

Thanks for the info. I mis-understood the beginning of that article so thanks for clearing that up. It makes more sense now!

However, it now does seem I need to go down the SMTP route instead, as the emails produced are not to come from a specific individual which if I am understanding it correctly, is not possible with the Lotus Notes model.

Thanks
Neil

I like work. It fascinates me. I can sit and look at it for hours...
 
OK, hold the phone here.

Email ALWAYS comes "from" someone. It may be a corporate "no reply" account, or some account established just for customer service. Even going with SMTP, you'll need a "from" address.

Even if the mail was allowed to go out without the "from" it wouldn't make it through most SPAM filters.

Don't throw away the baby with the bathwater here. It could be you just need to create an email account for this purpose.
 
Hi Dan!

Sorry I can't haven't explained myself fully. The from address I have, it's the from name I need to change, and it is that you can't seem to do with the Lotus Notes model, as it starts off with a specific account.

I like work. It fascinates me. I can sit and look at it for hours...
 
Neil, you misunderstand...

Of course you can repeat the .OpenDatabase() call for every other mail account, what hinders you to redo that step?

What you can't do, but also don't need to, is to change the mail sender, but you can change the .nsf file.

Only, if you don't know these files corresponding to the mail sender adresse, you need to revert to SMTP or any other mailing method.

But there should be a reason you want to do it with Lotus Notes, isn't there?

Bye, Olaf.
 
Is what you are trying to accomplish called sender spoofing? ;)

I manage a medium sized Domino/Notes environment and I have a feeling you're not going to be able to spoof the sender. Notes goes by the ID file of the mail file's user to determine the FROM on email.
 
What I am trying to achieve is a sitaution whereby the mail can originate from any account but the return name and email needs to be a specific (central) account.

For example, the central account is support (support@mycompany.com), someone mointors that and forwards it to me (fatslug@mycompany.com) as I am the best person to answer the query, but from all intents and purposes it has to 'look' like it came back from support@mycompany.com, and any 'reply to' to go back to that account.

I like work. It fascinates me. I can sit and look at it for hours...
 
This is starting to sound a little bit like "I have a hammer so everything looks like a nail" syndrome.

It sounds like you're really talking about routing and workflow management which is a task where Lotus Notes has no equal.

But if you insist on performing the task with email alone, well, even Lotus will tell you that Notes is not an email package. It happens to do email, but that's not really what it's for.
 
Actually my opinion as a customer is, once I have a response of someone from a service@company.com account or the like, I want to keep the correspondence with that person, as you need to repeat anything you already said, once three or four people get involved.

So why not let the answer come from the person actually answering the first mail?

If you compare the situation with outlook clients and an exchange server, lotus notes should be used in conjunction with lotus domino on the server side and all central answers should come from there.

So in the MS world you'd automate exchange server to let answers come from a central service mail adress and in the lotus world you'd need to do that from a domino server, not from a notes client.

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top