Hi everyone,
I have developed functionality to send sales documents by SMTP mail as PDF attachments. Everything goes fine, but when I want to delete sent files, Navision locks all sent files and these locks remains till Navision client has been closed. Then are files released and can be deleted (moved).
Environment:
NAV 2009 SP2 classic
Microsoft.Navision.Mail.dll version 7.0.0.0
What's wrong?
Thank you in advance
0
Comments
Files has unique filenames and are locked a hours ... exactly till Navision client has been closed.
Mail.SetHTMLBody(TRUE);
Mail.AddAttachment(DocQueue."Document No." + '.PDF',
CompanyInfo."Signed Folder" + DocQueue."Document No." + '_signed.pdf');
WITH SMTPMailSetup DO
Mail.SetConnectionParameters("SMTP Server", "SMTP Server Port", FALSE, TRUE, "User ID", Password);
Result := Mail.SendMail();
and mails are sent correctly, wihout any error.
Regards,
Thank you in advance
You need to extract the files where are the previous version and execute the bat (register_for_com) as Adminstrator.
You need to check the parameters in the Send method because they have changed from version 7.0.
And add the method Dispose after Send in codeunit 400.
Regards
I tried to manipulate with SMTP setting, but Anonymous, NTLM, Basic setting hasn't any effect with windows login.
What's wrong?
Verify that the user that starts the NAS have the rights to send mail in your Mail Server.
Regards.
I don't want to send mail as user who starts NAS. I want DLL to use permission saved in SMTP Setup table. It seems that DLL uses domain permissions of logged user and don't use parametersfrom calling trigger:
WITH SMTPMailSetup DO
Mail.SetConnectionParameters("SMTP Server", "SMTP Server Port", FALSE, TRUE, "User ID", Password);
I tried play with FALSE/TRUE parameters, but nothing changed.
>>>> Mail.SetConnectionParameters("SMTP Server", "SMTP Server Port", FALSE, TRUE, "User ID", Password);
In version 7.3 this is the way:
Mail.Send("SMTP Server", "SMTP Server Port", TRUE, "User ID", Password, FALSE);
The TRUE is for authentication and the FALSE for enableSSL, this last can be changed if you uses SSL along with the Server Port.
And you need to verify if your SMTP Mail Server allows that conection (user/password). You can use Outlook to configure the account and check it.
As I said, I played with FALSE/TRUE settings, but in all cases DLL uses the credentials of logged user (windows login) and never uses "User ID" and Password from SMTP setup.
With version 7.3 of DLL I actually use the following approach:
WITH SMTPMailSetup DO
Result := Mail.Send("SMTP Server", "SMTP Server Port", Authentication = Authentication::NTLM, "User ID", Password, FALSE);
but with Authentication set to Anonymous, NTLM or Basic - result is same - DLL logs to mail server with <domain>\<user> credentials.
I tell you that because I'm using this in several installations and it's working without any problem.
Regards
We tested connection with manual request to send and all works fine, but we used database login during these tests. When we moved functionality under NAS (windows login), we discovered that DLL uses this login whatever SMTP setting. Connection is established and email are sent, but customer wants to disallow windows credentials to mail server (remote, provider based).
Another problem is body encoding. Body is a HTML and this mail DLL uses UTF-16 encoding and on some mail servers/clients is content broken. Is the way to set encoding of HTML mail body?
You can try 'Microsoft CDO for Windows 2000 Library'.Message and 'Microsoft CDO for Windows 2000 Library'.Configuration instead of the Navision Mail DLL.
Regards.
Yes, I have the Navision Mail 7.3, here is the link with two 7.3 versions one newer than the other:
https://www.dropbox.com/s/1cb1x4pqdp17zag/Mail_Dynamics_NAV2009R2_V7.3.zip?dl=1
Regards
After register the new DLL you hae to change the Automation to the new version
And then you have access to change the port
For that you need to create the new field in the table or harcode the value.
Regartds.
Btw I renamed the old variable to mail2, so it's the new variable i'm using
The 7.3 version works, the error seems strange, maybe it is a conflict with the previous version.
Try to install in a clean environment.
Regards.
Sorry for the late reply, but had to leave the assignment for some time for other projects, but now I got the server restarted and reregistered the new dll.