File attach in Outlook message automatically

JAYESHJAYESH Member Posts: 290
Hi Experts,

I have wrote code when some one run report, system automatically sends an email to predefined users.

I know we can save report automatically when some one run report, but is there a way to attach saved HTML file in the email. From which all predefined users get an email and an attachment ?

Thanks,
JAYESH PATEL

Comments

  • KarenhKarenh Member Posts: 209
    I have modified codeunit 397 to attach documents such as Terms and Conditions. I put a condition on the subject.

    This is one such attachment:


    IF COPYSTR(Subject,1,5) = 'Quote' THEN BEGIN
    BSTRConverterAttachFileName.ResetBSTR;
    AttachFileName4 := CompanyInfo."External Document Directory" +
    'Company Info\Terms and Conditions.pdf';
    BSTRConverterAttachFileName.AppendNextStringPortion(AttachFileName4);
    OAttachments := OSendMail.Attachments;
    OAttachment := OAttachments.Add(BSTRConverterAttachFileName);
    END;


    I added a field to the Company Information table to indicate the drive letter for the shared files. All users have that same drive mapping.
Sign In or Register to comment.