I would like to send a mail through smtp (using NAS).
I would prefer not to install any external components just use a Navision component and specify the smtp server and send the message.
Anybody knows if navision has a standard component for this and the commands ??
kml:I would like to send a mail through smtp (using NAS). I would prefer not to install any external components just use a Navision component and specify the smtp server and send the message.
Hm, with an external, really nice ocx it is doable. Check out this or this.
I dont believe an navision email component exists to do what you are asking, so i think it will have to be an external one.
This may or may not be relevant but if you intend to have an email body with more than text than navision the internal buffer size can handle (255 chars in 2.60 and below, 1024 in 3.01 +, not sure about v4+) I would use one which allowed you to use the content of a text file as the email body, this would obviously require you to write the content to a temporary text file first but would not restrict you in email body length.
There are some nice and simple smtp components on the web that would probably do the job you need.
kml: I would like to send a mail through smtp (using NAS). I would prefer not to install any external components just use a Navision component and specify the smtp server and send the message.
Hi,
You don't need to install anything because SMTP is a network service native to Windows. You simply add two OCXs as C/AL Global Variables:
Navision is only an application running on top of all these Windows and network services. Though you could use Outlook Object Model to achieve the same, I would suggest that you stick w/ Windows native service.
However you will always get this warning: "A program is trying to automatically send e-mail on your behalf. Do you want to allow this?" and there is no way to turn it off. You can learn more about MAPI in Microsoft KB and MSDN.
Scott
I have used the MAIL codeunit to send email. However, I need a session with outlook to send email. But the result is okay.
Richard
I finally ended up sending smtp directly from navision just using standard MS components
and it works fine and do not prompt if you want to send mail and do not need outlook client installed but going directly on the smtp server.
I have not checked out the standard SMTP features which are now shipped in NAV 5.0
Is it possible now possible to send a mail with HTML content embedded in the body "out-of the box", that's without using any 3rd party component
(I'm not talking about file attachment here but a mail body in HTML)