Sending via SMTP from Notes

My Notes client primarily sends and receives via Domino (works fine in general). I also receive messages via some POP accounts (also works fine). Sometimes, however, I want to specificy to send via a non-Domino SMTP server. I can’t figure out how to specificy a different server for sending for certain messages without going to a whole new location document, and even that doesn’t allow for bulk specification of a different “Reply to” address.

I have the SMTP server set up in my Address Book | Advanced | Accounts. If I turn off Send messages via Domino in the location document then it will send via an SMTP server (can I select which one as I send the message?)

So, I really have two questions:

  1. 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?

  2. 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.

Thanks,

Colin

Subject: Sending via SMTP from Notes…

My Notes client primarily sends and receives via Domino (works fine in general). I also receive messages via some POP accounts (also works fine). Sometimes, however, I want to specificy to send via a non-Domino SMTP server. I can’t figure out how to specificy a different server for sending for certain messages without going to a whole new location document, and even that doesn’t allow for bulk specification of a different “Reply to” address.

I have the SMTP server set up in my Address Book | Advanced | Accounts. If I turn off Send messages via Domino in the location document then it will send via an SMTP server (can I select which one as I send the message?)

So, I really have two questions:

  1. 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?

You cannot do this per message, it is location dependent.

  1. 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.

This is the InternetAddress field in the location document, again it is per location.

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:

  1. 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.

  1. 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