Q:

AX 2009 attacments inside Lotus Notes richtext

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?

A:

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("From@address.com","");
    emailTo = new System.Net.Mail.MailAddress("To@address.com","");

    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();
}

