Sending Mail from navision with more than one body line
KeesMeuzelaar
Member Posts: 26
I try to send a mail from navision and i want to add a text, however this code which is a stripped version from the method used by notification management from commerce portal, places all texts after another, i cannot display
Dear Customer,
This is an Order.
It wil always do Dear CustomerThis is an Order.
Does anybody know how to create an enter.
IF ISCLEAR(OApplication) THEN
CREATE(OApplication);
IF (NOT OApplication.Logon(TRUE,'','',FALSE,FALSE)) THEN BEGIN
OApplication.Logoff;
EXIT
END;
IF ISCLEAR(OSendMail) THEN
CREATE(OSendMail);
OSendMail."To" := 'Kees.meuzelaar@wanadoo.nl';
OSendMail.BCC := 'kees@meuzelaar.com';
IF ISCLEAR(BSTRConverterBody) THEN
CREATE(BSTRConverterBody);
Body := 'TEST';
BSTRConverterBody.AppendNextStringPortion(Body);
BSTRConverterBody.AppendNextStringPortion(Body);
OSendMail.Body := BSTRConverterBody;
OSendMail.Subject := 'testmail';
IF ISCLEAR(BSTRConverterAttachFileName) THEN
CREATE(BSTRConverterAttachFileName);
AttachFileName := 'pipo.txt';
BSTRConverterAttachFileName.ResetBSTR;
BSTRConverterAttachFileName.AppendNextStringPortion(AttachFileName);
OAttachments := OSendMail.Attachments;
OAttachment := OAttachments.Add(BSTRConverterAttachFileName);
OSendMail.BodyFormat := 1;
OSendMail.OpenDialog := TRUE;
OSendMail.Send;
ErrorNo := OSendMail.ErrorStatus;
OApplication.Logoff;
Dear Customer,
This is an Order.
It wil always do Dear CustomerThis is an Order.
Does anybody know how to create an enter.
IF ISCLEAR(OApplication) THEN
CREATE(OApplication);
IF (NOT OApplication.Logon(TRUE,'','',FALSE,FALSE)) THEN BEGIN
OApplication.Logoff;
EXIT
END;
IF ISCLEAR(OSendMail) THEN
CREATE(OSendMail);
OSendMail."To" := 'Kees.meuzelaar@wanadoo.nl';
OSendMail.BCC := 'kees@meuzelaar.com';
IF ISCLEAR(BSTRConverterBody) THEN
CREATE(BSTRConverterBody);
Body := 'TEST';
BSTRConverterBody.AppendNextStringPortion(Body);
BSTRConverterBody.AppendNextStringPortion(Body);
OSendMail.Body := BSTRConverterBody;
OSendMail.Subject := 'testmail';
IF ISCLEAR(BSTRConverterAttachFileName) THEN
CREATE(BSTRConverterAttachFileName);
AttachFileName := 'pipo.txt';
BSTRConverterAttachFileName.ResetBSTR;
BSTRConverterAttachFileName.AppendNextStringPortion(AttachFileName);
OAttachments := OSendMail.Attachments;
OAttachment := OAttachments.Add(BSTRConverterAttachFileName);
OSendMail.BodyFormat := 1;
OSendMail.OpenDialog := TRUE;
OSendMail.Send;
ErrorNo := OSendMail.ErrorStatus;
OApplication.Logoff;
0
Comments
-
If I remember correctly this might work:
ch : char; ch := 13; message('line1' + ch + 'line2');Navision developer0 -
Maybe better :lzr wrote:If I remember correctly this might work:ch : char; ch := 13; message('line1' + ch + 'line2');txt : text[2] txt := 'XX'; txt[1] := 13; txt[2] := 10; message('%1','line1' + txt + 'line2');Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
BSTRConverterBody.AppendNextStringPortion(Body);
This body has to be a text you cannot use a character.
I already tried to use 13 in the text, the solution was to use the following code
Char := 13
Body := Text + FORMAT(Char) + Text0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 322 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions