Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AX 2009 attacments inside Lotus Notes richtext

Tags:

It is possible using AX 2009 to create email body in Lotus Notes and attach pdf or xls files inside email in needed place providing text for each attached file, and make this embedded objects clickable and possibility to rename them?

enter image description here

like image 482
Dmitrij Holkin Avatar asked Aug 29 '18 08:08

Dmitrij Holkin


1 Answers

Try this job as a test with your file...

static void TestEmails(Args _args)
{
    System.Net.Mail.MailMessage             mailMessage;
    System.Net.Mail.Attachment              attachment;
    System.Net.Mail.AttachmentCollection    attachementCollection;
    System.Net.Mail.SmtpClient              smtpClient;
    System.Net.Mail.MailAddress             emailfrom;
    System.Net.Mail.MailAddress             emailto;
    str                                     messageBody;
    str                                     Subject;
    str                                     SMTPServer;
    str                                     Filenm;
    FileIOPermission                        permission1;

    str fileToSend;
    ;

    fileToSend = "P:\\Tests\\TestFile.pdf";

    emailfrom = new System.Net.Mail.MailAddress("[email protected]","");
    emailTo = new System.Net.Mail.MailAddress("[email protected]","");

    messageBody = "Test Body";
    Subject = "Test Subject";
    SMTPServer = SysEmailParameters::find(false).SMTPRelayServerName;

    mailMessage = new System.Net.Mail.MailMessage(emailfrom, emailTo);

    mailmessage.set_Subject(Subject);
    mailmessage.set_Body(messageBody);

    attachementCollection = mailMessage.get_Attachments();
    Filenm = fileToSend;
    permission1= new FileIOPermission(Filenm,'w');
    permission1.assert();

    attachment = new System.Net.Mail.Attachment(Filenm);
    attachementCollection.Add(attachment);

    smtpClient = new System.Net.Mail.SmtpClient(SMTPServer);
    smtpClient.Send(mailmessage);

    CodeAccessPermission::revertAssert();
}
like image 165
manderson Avatar answered Sep 28 '22 17:09

manderson