Sending Email in NAV2009

Hi all,

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

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

objEmail.From := XXXX;
g_txtEmailAddress:=g_recNotificationSetupTable2.“Job Task Notification”;
IF g_txtEmailAddress<>’’ THEN
BEGIN
objEmail.“To”:=g_txtEmailAddress;
objEmail.CC:=XX;
objEmail.Subject:=g_txtSubject;
objEmail.HTMLBody:=g_txtHtmlHeader+g_txtBody+g_txtHtmlFooter;;
objEmail.Send;
END;

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 ?

Hi

Look at this link

http://www.mibuso.com/dlinfo.asp?FileID=519

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