How do I send e-mail using an agent?

It is possible to send e-mail generated by an agent, however you must use the "Principal" field to control who the e-mail is addressed from. Here is a script that is known to work on our servers:

 

Dim session As New NotesSession

Dim db As NotesDatabase

Set db = session.Currentdatabase

Dim doc as New NotesDocument(db)

doc.SendTo = "user@mydomain.com"

doc.Principal = "FirstName LastName <me@mydomain.com@NotesDomain>"

doc.From = "me@mydomain.com"

doc.SMTPOriginator = "me@mydomain.com"

doc.iNetFrom = "me@mydomain.com"

doc.Subject = "Hello"

doc.Body = "Nice to know you"

Call doc.Send(False)

 

The doc.Principal line is the most important... be sure that "@NotesDomain" reads as is... do not substitute an actual Notes domain name.

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.
Powered by Zendesk