Domino 9 und frühere Versionen > ND6: Entwicklung

Absendeadresse wenn ein Agent ein Mail versendet?

<< < (5/15) > >>

m3:
Seufz. Würdet Ihr bitte die von mir verlinkte FAQ lesen? Dort steht ALLES drinnen - auch wie man den Absender "ändert".

coma:
Hallo m3,

habe mir deinen Link schon angesehen, der interessante Part dachte ich wäre hier:


--- Zitat ---1) How to change the apparent sender of the agent generated mail.
Information on three different ways to do it with code samples has been moved to the "Troubleshooting agents" article.
http://www-10.lotus.com/ldd/today.nsf/62f62847467a8f78052568a80055b380/ef1565a0b202808285256c94004fd0fb?OpenDocument&Highlight=0,kadashevich
--- Ende Zitat ---

Aber: Draufgeklickt und kommt nix ausser 'ner Suchmaske....

Gruß, Ralf.

coma:
ok, hab mal aufmerksam gelesen. Ist einfach nicht mehr richtig verlinkt der Artikel, da dieser jetzt in "Troubleshooting agents..." steckt.

Dort steht:


--- Zitat ---How can I change the apparent sender of agent generated mail?

Sometimes you need to generate mail from an identity different from your own. For example, you may want to generate mail from the user Domino Administrator. There are three ways to do this:

    * Create a special ID for user Domino Administrator and sign the agent with that ID.
    * Use the Principal field in the agent code to override the From field.
    * Use the Run on behalf of field (new in Notes/Domino 6).

The first method is the simplest because it requires no coding. It does, however, involve licensing and maintaining IDs. The second method is more flexible, but requires some coding. You don't need any special rights, but the information about the original sender is maintained for auditing purposes. By default, the mail template displays the original sender's name in the sent by field under the From field. There are three ways to specify the Principal field:

    * doc.Principal="Joe User/Org@NotesDomain" where Joe User/Org has a Person record with an InternetAddress of your choosing. (Note that the string @NotesDomain must be present.)
    * doc.Principal="CN=Joe User/O=Org" where Joe User/Org has a Person record with an InternetAddress of your choosing.
    * doc.Principal=User@acme.org@NotesDomain <mailto:User@acem.org@NotesDomain>. (Note that the string @NotesDomain must be present.)

If you only care about the ReplyTo address, you can use it instead of the Principal, which changes both the From and ReplyTo:

Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim doc As NotesDocument
Dim item As NotesItem
Dim ToWho(40) As String
Dim FirstName(40) As String
Dim Msg As String
Set db = session.CurrentDatabase
Set doc = New notesdocument(db)
'*******************************************************************

Count = 30
ToWho(0)="joe@yahoo.com"
FirstName(0)="Joe"

ToWho(1) = "teresa@yahoo.com"
FirstName(1)="Teresa"

<more initialization code removed>

doc.Principal = "julie@yahoo.com@NotesDomain"
doc.Form = "Memo"

doc.Subject=" Happy Holidays!"
For i=0 To count
Greet = "Hi " +FirstName(i) +", Happy Holidays!"
Msg1 ="additional text"
doc.Body=Greet + Msg1
Print toWho(i)
Call doc.Send(True,toWho(i))
Next


As we show in the preceding code, @NotesDomain is a string that is expected in the syntax. Omitting this is often the problem when people report that the Principal field is not working.

The third method (Run on behalf of) is new to Notes/Domino 6. This field in Agent Properties allows one user to run an agent as though it were invoked by another user. You need special rights to run agents on behalf of other users. These rights are controlled through the "Sign agents to run on behalf of someone else" field in the Security tab of the Server document. If they have this permission, mail appears to come from the name specified in the Run on behalf of field. This is a very high level of rights and should only be granted carefully, as it allows one user to run agents on behalf of other users, including having their ACL rights when accessing databases.
--- Ende Zitat ---

coma:
So, nachdem dort steht...


--- Zitat ---The first method is the simplest because it requires no coding. It does, however, involve licensing and maintaining IDs. --->>> Create a special ID for user Domino Administrator and sign the agent with that ID.
--- Ende Zitat ---

...und ich es quick and dirty haben möchte meine Frage:

Wie macht man das nun?

Gruß,
Ralf.

koehlerbv:
1.) Darfst Du Notes-IDs erzeugen?
2.) Weisst Du, wie man dann damit umzugehen hat, um das Ziel zu erreichen?

Offensichtlich können nicht beide Fragen mit "ja" beantwortet werden, sonst würdest Du nicht von uns erwarten, dass wir Deine Arbeit machen.

Das soll als Erklärung dienen, warum hier niemand mehr antwortet: Du willst nicht lernen, Du willst eine schnelle Lösung (= fertige Lösung von anderen) - das funktioniert nicht.

Bernhard

Navigation

[0] Themen-Index

[#] Nächste Seite

[*] Vorherige Sete

Zur normalen Ansicht wechseln