Options

2015 Microsoft.Dynamics.Nav.SMTP.SmtpMessage BROKEN???

OldNavDogOldNavDog Member Posts: 88
edited 2014-10-28 in NAV Three Tier
TO NAV DEVELOPMENT TEAM:

I'm pretty sure you never tested the SMTP Mail Functions in NAV 2015.

If you had, you would know by now that the "AddAttachment" Function, and the DOTNET Assembly it calls, are SERIOUSLY BROKEN!!!

First off, in the "AddAttachment" Function, you have added a "FileName" Argument. Or you can say that you added an "Attachment" Argument. Either way, Fine.

But then you do an "EXISTS" Test on the ATTACHMENT Parameter, NOT the FILENAME Parameter. BAD Developer!!!

However, it gets MUCH Worse.

When I corrected THAT error, then I was STILL getting an error that A COMPLETELY BOGUS PATHNAME Was "Not Found"!!!

My "FileName" Argument (straight from the Debugger) was "'\\ccss02\e\FTP Site\AutoPilot2015\DeliveryFiles\A_P-95D92C2C8DA46EBA_60\PDFCreator.pdf'"

HOWEVER, when I continue on in the Debugger into the "Mail.AddAttchmentWithName" Function (which is calling the DOTNET Assy), I get a "Result" that states the following:

"'Could not find file 'C:\Windows\system32\PDFCreator.pdf'.'"

Now, I ASSURE you that that is NOT the PATH that I entered that DOTNET Call with (again, verified with the Debugger).

So, What's Up YET AGAIN with the SMTP Codeunit (and DOTNET Assy???) :x :x :x

There is NOTHING NEW in SMTP. LEAVE THAT CODEUNIT ALONE!!! EVERY SINGLE TIME NAV UPDATES, YOU BREAK THIS FUNCTIONALITY!!!

FIX THIS PLEASE!!!
Experience is what you get, when you don't get what you want. --Anon.

Comments

  • Options
    KraverKraver Member Posts: 17
    Any news on this?
    Microsoft, pls
  • Options
    OldNavDogOldNavDog Member Posts: 88
    Any word on this?
    I just coded around it.

    You can fix the code in the AddAttachment Function like so:
    AddAttachment(Attachment : Text;FileName : Text)
    IF Attachment = '' THEN
      EXIT;
    
    //AttachFix Start - Fix NAV Error! New Argument "Filename" was added; but code below was not adjusted to use the EXISTS against it!
    
    //IF NOT EXISTS(Attachment) THEN
    IF NOT EXISTS(FileName) THEN //AttachFix - Fixed the above line with this line
      ERROR(Text002,Attachment);
    
    //Result := Mail.AddAttachmentWithName(Attachment,FileName); //THIS DOTNET ASSEMBLY IS COMPLETELY BROKEN!!! THIS METHOD IS USELESS UNTIL FIXED BY NAV.
    Result := Mail.AddAttachments(FileName); //Until NAV/MS Fixes this, use an "Alternate" DOTNET Method that can still accept a TEXT Argument for Filename
    
    //AttachFix Finish
    
    IF Result <> '' THEN
      ERROR(Text003,Result);
    

    Hope this helps!
    Experience is what you get, when you don't get what you want. --Anon.
Sign In or Register to comment.