Subject: Notes POP/SMTP users unite! (re. Sending via SMTP from Notes…)
Always good to find someone else who makes use of the POP mail account feature of the Notes client.
To answer your questions:
- How do I specify which SMTP server (or Domino account) based on the message? Must I change the location document every time I want to send via different server?
Yes, as David has replied, the server can only be set in the Location document. For this reason, I regularly use 5 different location documents, with different Notes IDs attached to them (as well as another half dozen for testing). But location documents are A Good Thing! I think we need to encourage Lotus/IBM to develop them further and make them still more usable. For example, a table-like display in the Replicator page which clearly shows (and allows you to set) which databases are being replicated from which locations would be a godsend.
- Is there any way to specify a “Reply to” address for all messages, or all messages going from a given Location. I can set it for 1 at a time from the Delivery Options | Advanced tab, but I want to set it to default to a different “Reply to”, or like in programs like Outlook Express, just select which SMTP and Reply To address in the From drop down with every message.
The Internet Address field in the location document is involved, but so too (not so well documented) is the “This mail file belongs to” field in the mail database’s Actions, Tools, Preferences dialogue - actually stored as the “Owner” field in the “calendarprofile” profile document.
I found that unless this field was correctly set, people replying to my internet mails were getting delivery failures because the return address was incorrectly formatted. This was because some internet mails were sent out directly to my external SMTP server, and other via my Domino server (depending on location, of course!). For this reason I’ve added a postopen script to my mail database, which sets the Owner field based on the location document. It’s undocumented (and uses a Goto - Hey, I’m an administrator, right, not a code jockey), but you’ll get the idea:
Sub Postopen(Source As Notesuidatabase)
Dim session As New NotesSession
Dim db As NotesDatabase
Dim change As String
Dim calprofuidoc As NotesUIDocument
Dim calprofdoc As Notesdocument
Dim ws As New NotesUIWorkSpace
Dim curloc, tmpstring, useloc, mfowner As String
Dim a As Integer
Set db = session.CurrentDatabase
Set calprofdoc = db.GetProfileDocument("calendarprofile")
curloc=session.GetEnvironmentString("Location", True)
For a=1 To Len(curloc)
tmpstring=Left(curloc,a)
If Right(tmpstring,1)="," Then useloc=Left(curloc,a-1)
If Right(tmpstring,1)="," Then Goto FOUND
Next
FOUND:
If useloc = "Location 1" Or useloc = "Location 1a" Or useloc = "Location 1b" Then
mfowner = "CN=John Kelman/O=Org1"
Elseif useloc = "Location 2" Then
mfowner = "CN=John Kelman/O=Org2"
Else
<<insert your code here if necessary to cater for additional locations, or even prompt for a mail file owner if applicable>>
End If
Call calprofdoc.ReplaceItemValue("Owner", mfowner)
Call calprofdoc.Save(False, False)
End Sub