Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

Adding a Signature to an email

Posted on by Microsoft Employee

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

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    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.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Adding a Signature to an email

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

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    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
    TharangaC Profile Picture
    TharangaC 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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans