hi good morning ,
can we send a mail from navision to the other employees birthday in the company
i worked on previous code unit smtp mail ,can any one can suggest me please.
thanks one and all
hi good morning ,
can we send a mail from navision to the other employees birthday in the company
i worked on previous code unit smtp mail ,can any one can suggest me please.
thanks one and all
Balu, can you tell us what did you try…
OnRun()
createmessage(‘SURESH’,‘VIZAG’,‘sbadireddi@technobrainltd.com’,‘wishes’,‘happy birthday’,TRUE);
sendto();
addrecipients(‘spagolu@technobrainltd.com’);
addcc(‘spagolu@technobrainltd.com’);
addbcc(‘spagolu@technobrainltd.com’);
addatachments(‘C:\Users\Public\Pictures\Sample Pictures’);
createmessage(sendername : Text[30];senderaddress : Text[30];recipients : Text[30];subject : Text[30];body : Text[30];htmlformatted : B
IF recipients <> ‘’ THEN
smtpmailsetup.GET;
smtpmailsetup.TESTFIELD(“SMTP Server”);
IF ISCLEAR(mail) THEN
CREATE(mail);
mail.FromName :=sendername;
mail.FromAddress :=senderaddress;
mail.“To” :=recipients;
mail.Subject :=subject;
mail.Body :=body;
mail.HtmlFormatted :=htmlformatted;
sendto()
WITH smtpmailsetup DO
result :=
mail.Send(
“SMTP Server”,Authentication <> smtpmailsetup.Authentication::Anonymous,“User ID”, Password);
CLEAR(mail);
IF result <> ‘’ THEN
ERROR(text003,result);
addrecipients(recipients : Text[30])
result := mail.AddRecipients(recipients);
IF result <> ‘’ THEN
ERROR(text003,result);
addcc(recipients : Text[30])
result := mail.AddCC(recipients);
IF result <> ‘’ THEN
ERROR(text003,result);
addbcc(recipients : Text[30])
result := mail.AddBCC(recipients);
IF result <> ‘’ THEN
ERROR(text003,result);
addatachments(attachments : Text[30])
IF attachments = ‘’ THEN
EXIT;
IF NOT EXISTS(attachments) THEN
ERROR(text002,attachments);
result := mail.AddAttachments(attachments);
IF result <> ‘’ THEN
ERROR(text003,result);
i have written this code but it was throughing an error about
Did you create above function?
if yes, Why not to use base functions?
Did you set SMTP Mail Setup under Administration–>IT Administration–>General Setup–>SMTP mail setup?
Mr.Balu
I suggest you go through the manuals and try the examples given in Manual ,Understand the concept of every functionalists.
This will help you in understanding the concept.