The email address "From Email" is not valid.

Hi team,

I customized these pages:
1.) Leave Application - Open which contain send request approval
2.) Leave Application - Pending which contains approve, reject and cancel request approval
3.) Leave Application - Approved which contain post.

In the Leave Application - Open, under send request approval I wrote the code below:

EmployeeLeave.RESET;
EmployeeLeave.SETRANGE("Application No","Application No");
IF EmployeeLeave.FIND('-') THEN BEGIN
EmployeeLeave.Status := EmployeeLeave.Status::"Pending Approval";
EmployeeLeave."Approval Date" := TODAY;
EmployeeLeave."Approved Start Date" := TODAY;
EmployeeLeave.MODIFY;
MESSAGE(Text001,"Application No");
END;

IF "User ID" <> '' THEN BEGIN
IF UserSetup.GET("User ID") THEN BEGIN
SubjectText := 'Microsoft Dynamics NAV Notification';
BodyText := 'Microsoft Dynamics NAV Approval Sytem';
SMTPMail.CreateMessage('EMPLOYEE','From Email',UserSetup."E-Mail",SubjectText,BodyText,TRUE);
SMTPMail.AppendBody('<br><br>');
SMTPMail.AppendBody('Leave Application'+''+'<b>"Application No"</b>'+''+'an approval request has been sent.');
SMTPMail.AppendBody('<br><br>');
SMTPMail.AppendBody('<b>User ID:</b>'+''+FORMAT(USERID));
SMTPMail.AppendBody('<br><br>');
SMTPMail.AppendBody('<b>Date:</b>'+''+FORMAT(TODAY));
SMTPMail.AppendBody('<br><br>');
SMTPMail.AppendBody('<b>Time:</b>'+''+FORMAT(TIME));
SMTPMail.AppendBody('<br><br>');
SMTPMail.AppendBody('<br>');
SMTPMail.Send;
END;
END;

Once I click the send request approval error message is displayed "The email address "From Email" is not valid."

Comments

Sign In or Register to comment.