Navision Email

Hello there.

Today I was asked to do something a bit more “hard core” than I’m used to.

I was asked to work with emailing in Navision.

So, for now, I need to know how to add multiple recipients to an email message.

I know the codeunit mail already has the OpenNewMessage function, but, from what I could tell, it only adds one email contact at a time. Is there another function, or a way to edit that function, so that I can add emails directly from a table?

There are two mail codeunits, Mail and SMTP Mail. You should be able to look at the code and see how the functions handle the email addresses. I forget whether you can separate them by commas or semi-colons, but you should be able to send to more than one email address.

Yup, if you use SMTP codeuinit( 400) then you should look for AddRecipients .

Or you can also do the plsit with commas as Matt suggested.

g.

I almost did it, but now I have another question.

I am using the notepad application in order to store text, and now I need to be able to sent that text as the email body. Is there a way to do that?

Do you mean you atuomate it or you stored it in a text file ?

g.

I automated it. I opened the application, wrote some text there and saved.

IF you need to open a file and read contents then look for file stream handling.

one example is here :http://dynamicsuser.net/forums/p/9393/32303.aspx

Otherwise with the automation object you have access to contents already .

with the smtp class you have the AppendBody function to add the read data to the email.

gabor

I managed to do what I wanted. Had to change the Attachment Management codeunit a little bit.

But now I have to face another challenge…

Right now, I am able to choose a list of contact, write the email body content in a notepad and send that content automatically without even seeing anything (what I mean is, I don’t have to use Outlook to send the emails). But, is it possible to receive a delivery report and a read receipt for the emails I’m sending via Navision? Can I receive those in Outlook?

I’m not sure about the delivery report, never done it, but if you are using Outlook automations you can definitely set the Read Receipt property. Have a look around MSDN in the Outlook sections.

I can’t find anything I can use. Do you have a link that I could read?

http://msdn.microsoft.com/en-us/library/microsoft.office.interop.outlook._mailitem_members.aspx

Lists all of the members of the MailItem interface for Outlook. I see one for ReadReceiptRequested, but there’s not one that immediately pops out for Delivery