Manage Learn to apply best practices and optimize your operations.

Remove invalid e-mail addresses

LotusScript Agent to parse Names field "EnterSendTo" in memo form of the mail5.0 template. Agent will remove any items not containing the @ symbol, and as it is doing so will report each address in a prompt, append each item one by one, and display count of valid addresses when finished. The prompts are meant to be removed, they are only there as a highlighter. Once prompts are removed, this agent will serve to avoid the "Name not found, OK to skip, etc" message by auto modifying the SendTo list prior to the field refresh.
Sub Initialize
	Dim ns As New NotesSession
	Dim nws As New NotesUIWorkspace
	Dim uidoc As NotesUIDocument	
	Dim ndoc As NotesDocument
	Dim subj As Variant
	Dim count As Integer
	Dim inx As Integer	
	count = 0
	Set ndoc = nws.CurrentDocument.Document	
	subj = ndoc.GetItemValue( "EnterSendTo" )
	Call nws.CurrentDocument.FieldSetText("EnterSendTo", "") 
	Forall s In subj
		If Instr(s,"@") >0 Then
			Call nws.CurrentDocument.FieldAppendText("EnterSendTo",
 s + ",")
			Msgbox s, 32, "Valid" 
			count = count + 1
			Msgbox s, 32, "Invalid -- Value Removed"	
		End If
	End Forall
	Msgbox count, 32, "Number of Valid Addresses" 

End Sub

Dig Deeper on Domino Resources - Part 5

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.




  • iSeries tutorials's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...