Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Adding a Signature to an email

(0) ShareShare
ReportReport
Posted on by

In my function it creates an email with attachments etc. Is there an existing function to add a signature to an email through code. I can't find any current solutions. 

The signature just contains a load of text. 

Thank you.

*This post is locked for comments

  • RE: Adding a Signature to an email

    I've added this code to my email sending function.

    On the Line FileManagment.BLOBExport(TempBlob,'C:\Users\LewisH.TIOGA-DOMAIN\Signature',FALSE); thats where I want it to retrieve the image from. Within the BlobExport Function how can i change it to attach the image from that path?

    recCompanyInfo.CALCFIELDS(Picture);

     IF recCompanyInfo.Picture.HASVALUE THEN BEGIN

       TempBlob.INIT;

       TempBlob.Blob := recCompanyInfo.Picture;

       TempBlob.INSERT;

       FileName := FileManagment.BLOBExport(TempBlob,'C:\Users\LewisH.TIOGA-DOMAIN\Signature',FALSE);

     END;

     cuSMTP.AppendBody('<IMG style="HEIGHT: 153px; WIDTH: 445px" src="file:///'+ FileName +'"'+ 'width=100 height=100>');

     cuSMTP.Send;

    BlobExport Code:

    BLOBRef.Blob.CREATEINSTREAM(NVInStream);

    IF STRPOS(Name,'*') = 0 THEN

     ToFile := Name

    ELSE BEGIN

     ToFile := INSSTR(Name,Text001,1);

     ToFile := DELCHR(ToFile,'=','*');

    END;

    WHILE STRPOS(ToFile,'\') <> 0 DO BEGIN

     p := STRPOS(ToFile,'\');

     ToFile := COPYSTR(ToFile,p + 1);

    END;

    Path := 'C:\TEMP';

    IF NOT CommonDialog THEN

     Path := Magicpath;

    DOWNLOADFROMSTREAM(NVInStream,Text006,Path,GetToFilterText('',Name),ToFile);

    EXIT(ToFile);

  • Binesh Profile Picture
    Binesh 7,885 on at
    RE: Adding a Signature to an email

    As your wish, you can also put logo/image, but text is little bit fast.

    so if you don't want image then skip the logo/image code.

  • RE: Adding a Signature to an email

    If possible Adding an image to the signature would be ideal, otherwise just text is useful.

  • RE: Adding a Signature to an email

    Thank you. I'm struggling to follow the code to match my own needs.

    Here is my current code:

    recTiogaSetup.FINDFIRST;

    IF blnFound1 = TRUE THEN BEGIN

     IF objMscorbFile.Exists(recTiogaSetup."Job Queue Document Folder" + recPurchaseOrderTMP."Buy-from Vendor No." + '.xlsx') THEN

       objMscorbFile.Delete(recTiogaSetup."Job Queue Document Folder" + recPurchaseOrderTMP."Buy-from Vendor No." + '.xlsx');

     recExcelBufferTMP.CreateBookJobQueue(recPurchaseOrderTMP."Buy-from Vendor No.");

     recExcelBufferTMP.WriteSheet('Outstanding Purchase Order','TIOGA',USERID);

     recExcelBufferTMP.columns.AutoFit;

     recExcelBufferTMP.CloseBook();

     recVendor.GET(recPurchaseOrderTMP."Buy-from Vendor No."); // TIO000016

     strEmailNo :=

     cuSMTP.EmailRecordMessageCreateWithStdLogo(    // TIO000016

       recVendor."Order Confirmation Email",

       '',

       STRSUBSTNO(

         Text015

         ));

     cuSMTP.EmailRecordMessageFileandFolder(strEmailNo, recPurchaseOrderTMP."Buy-from Vendor No." + '.xlsx' ,recTiogaSetup."Job Queue Document Folder");

     cuSMTP.EmailRecordMessageLineBlank(strEmailNo,2);

     cuSMTP.EmailRecordMessageLine(

       strEmailNo,

       STRSUBSTNO(

         Text016

         ),

       STRSUBSTNO(

       Text019

         ),

       FALSE

       );

     cuSMTP.EmailRecordMessageEnd(strEmailNo);

    END;

  • Suggested answer
    Binesh Profile Picture
    Binesh 7,885 on at
    RE: Adding a Signature to an email

    Hello Lewis,

    We are not aware of your code that you written,

    anyway you can add signature.

    just you need to Append the body before sending the email.

    See the link for reference Use Email with Company Logo

    Still if you have any doubt then share your code we will tell you, what & where you need to add.

  • Suggested answer
    Tharanga Chandrasekara Profile Picture
    Tharanga Chandrasekara 23,116 on at
    RE: Adding a Signature to an email

    Check below link : http://saurav-nav.blogspot.co.nz/2015/08/nav-2015-use-email-with-company-logo.html

  • Suggested answer
    RockwithNav Profile Picture
    RockwithNav 6,562 on at

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,432 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans