Hi Fernando,
What version of dotLRN are you using?
In any case, until dotLRN 2.4, emails are sent out using the smtp library and in very few cases ns_sendmail. As of upcoming version 2.5.0, ns_sendmail won't be used anymore.
smtp is configures in the parameters of the acs-mail-lite package. Go to the site-wide admin pages (http://yourserver/acs-admin), click on "parameters" next to "ACS Mail Lite" and edit the parameters under the "SMTP" section of the form.
ns_sendmail is configured in the config.tcl file. I'm not sure on how to configure the mail server port there though.
In any case, I would recomend that you replace calls to ns_sendmail with ones to acs_mail_lite::send