Question : Why are my agents behaving differently since we migrated our Notes server from Windows 2003 to an AS/400?

A couple of weeks ago we migrated our Domino 7.0.2 apllication server over to our AS/400 from a Windows 2003 server.  Since then we've been noticing strange quirks that have started occuring when scheduled agents run.

One example in particular would be for agents that use the NotesRichTextTable Class.  These agents would generate emails out to users in an organized table format.  All columns in the table would be properly justified.  Now since the migration, the emails have been going out with the line justification off-centered on every other row of the table.
These agents ran fine before the migration and also will run ok if I launch them from my local Notes client (Windows XP).

Does anyone have any clue why running an agent with Domino on the 400 would have a different behavior like this?

Answer : Why are my agents behaving differently since we migrated our Notes server from Windows 2003 to an AS/400?

The AS/400 (ISeries) uses EBCDIC format.  It is very quirky that way.  Depending on what you are doing, I'd recommend the best approach to this is spit out the content in HTML format.

In the body of the e-mail put this:
bodyText="<HTML><HEAD><META http-equiv=""Content-type"" content=""text/html; charset=iso-8859-1""><TITLE>subjecttext</TITLE></HEAD><BODY>Put in all HTML tables, etc here.</BODY></HTML>"

If you need help with html, you can compose the basic format in MS Word and save the doc to html, you can copy that html over, make changes to it, filling in valid data, etc, then just send it.  The best approach is using LotusScript in your agent to compose the e-mail.

Dim bodyText As String, subjectText As String
Dim body As NotesMIMEEntity
Dim header As NotesMIMEHeader
Dim stream As NotesStream

Set stream = session.CreateStream
session.ConvertMIME = False ' Do not convert MIME to rich text
Set maildoc = New NotesDocument( db )
maildoc.Form = "Memo"
Set body = maildoc.CreateMIMEEntity
Set header = body.CreateHeader("Subject")
Call header.SetHeaderVal( subjectText )
Set header = body.CreateHeader("Reply-To")
Call header.SetHeaderVal( replytoperson )
Set header = body.CreateHeader("To")
Call header.SetHeaderVal( receipients )
Call stream.WriteText( bodyText )
Call body.SetContentFromText( stream, "text/html; charset=iso-8859-1", ENC_NONE )
Call maildoc.Send( False )

That should do it.  Now you'll receive the e-mails in HTML format and it the AS/400 won't have a change to screw up your fromatting.  Good Luck.
Random Solutions  
 
programming4us programming4us