Sending Email in NAV2009

Hi all,

I am doing a task of sending email in NAV2009. The following is part of my code:

IF g_recNotificationTable.“Smtp Server IP”=’’ THEN EXIT;
IF ISCLEAR(objEmail) THEN CREATE(objEmail);
flds := objEmail.Configuration.Fields;
fld := flds.Item('…/smtpserver’);:wink:
fld.Value(g_recNotificationTable.“Smtp Server IP”);
fld := flds.Item('…/smtpserverport’);:wink:
fld := flds.Item('…/sendusing’);:wink:

objEmail.From := XXXX;
g_txtEmailAddress:=g_recNotificationSetupTable2.“Job Task Notification”;
IF g_txtEmailAddress<>’’ THEN

But if the HTMLBody characters are larger than 1024, it can’t send the email. What should i do?

What exactly is your goal?

Did you check Codeunit 400 - SMTP Mail?

I didn’t use CodeUnit 400 - SMTP Mail to send email

I just want to do a sending email task. you know, if the HTMLBody character is larger than 1024, the email can’t be sent normally.

Why didnt you use Codeunit400?

is there any reason?

You can check for AppendBody function if exists or not…

No, because i always didn’t use codeunit 400 to do the sending email task . codeunit 400 can solve my problem ?


Look at this link

Hi Amol,

The report is not usefull, the largest character of the email body only 260, I hope the total character can larger than 1024.

thanks !

Did you check whether you have any Append body function available or not?

Which is objEmail automation variable?

Name DataType Subtype
objEmail Automation ‘Microsoft CDO for Windows 2000 Library’.Message
objEmailConf Automation ‘Microsoft CDO for Windows 2000 Library’.Configuration
fld Automation ‘Microsoft ActiveX Data Objects 2.5 Library’.Field
flds Automation ‘Microsoft ActiveX Data Objects 2.5 Library’.Fields