Hi,
I am generating email from Navision code unit MAIL.
I am facing problem while creating email body.
I am using newmessage() function to send the mail, But
I can not format the body of the email.
Please let me know how to use Mail.AddBodyLine()
function.
Darshan Mungekar
Senior Consultan
0
Comments
www.NextEqualZero.com
A technical eye on Dynamics NAV
I am writing below code in one of the report, which directly
sends an email to user. please tell me where to put code for
Mail.AddBodyline('body line 2');
Body := Item.Description + FORMAT(ValueEntryBuffer."Invoiced Quantity");
.....
......
Mail.NewMessage(SalesReceivablesSetup."Item Notify To",'','Item Sales Qty',Body,'',FALSE);
Senior Consultan
Senior Consultan
You will have to split code in NewMessage where body is appended.
I.e. for only one new-line:
i m also facing the same problem.
i hv put folloeing code in function NewMessage in codeunit mail:
I.e. for only one new-line:
Code:
IF Body <> '' THEN BEGIN
BSTRConverterBody.ResetBSTR;
if strpos(body,'\') <> 0 then
begin
appendnextstringportion(copystr(body,1,strpos(body,'\'));
appendnextstringportion(copystr(body,strpos(body,'\')+1,260);
end
else BSTRConverterBody.AppendNextStringPortion(Body);
end ;
but in this fuction above of this code there are couple of lines:
IF (NOT OApplication.Logon(TRUE,'','',FALSE,FALSE)) THEN BEGIN
OApplication.Logoff;
EXIT
END;
this is the fourth line in this function. From here Exit function is working and my remaining function is not executing.
plz suggest something.
Senior Consultan
You can try changing the code to look like this:
Old:
New: or
where profilename is the name of the outlook profile and MailPW the appropriate password. But beware of the security issue when setting a hardcoded plaintext password!
MCP+I, MCSE NT, Navision MCT (2004,2005)
But i want to create a email body with multi line, which i am not
able to do...
Senior Consultan
Have you tried it like this
Albert
MCP+I, MCSE NT, Navision MCT (2004,2005)
i hv used this code also but still all the data is going in single line in body.
plz suggest something else.
I had to do some testing for a project with sending emails, but that piece was scrapped. So I had the same problem and I never got around to trying it by passing through those characters manually. It may be worth a try.
Epimatic Corp.
http://www.epimatic.com
For the linefeed, simply add the CRLF like this:
MCP+I, MCSE NT, Navision MCT (2004,2005)