Sending picture in the body of an email
finder
Member Posts: 129
Hi,
Is it possible in NAV 5.0 to send an email with picture but not as an attachment but in the body of an email. I used CU SMTP Mail for sending emails and it works properly but didn't find that kind of possibility.
Thanks in advance,
Anti
Is it possible in NAV 5.0 to send an email with picture but not as an attachment but in the body of an email. I used CU SMTP Mail for sending emails and it works properly but didn't find that kind of possibility.
Thanks in advance,
Anti
0
Answers
-
I've never tried to do this from Nav but an email with an embedded image is nothing more than an html file with the image mime encoded and a marker in the body of the message which says display attachment xxx here.
Its a bit labourious but constructing the html is not difficult. The html you construct is simply the body of the message.
Create an email in outlook and examine the structure and you can see what you are aiming for.
Alternately, if you are using an exchange server you have the CDO api which allows you to do this. Mapi may do as well but its not so flexible.
Ian0 -
Codeunit 400 (SMTP) does have functionality to build up the body (AppendBody function) of the email and attach files (AddAttachment function). These 2 functions coupled with the HTMLBody flag at the end of the CreateMessage function are what I would play with to try and send out a picture in an email. You will to construct all the HTML in text (or maybe read it from a file/template) and then just refer to the attachment.
This should make it a little cleaner and you don't have to worry about mucking about with automation variables.0 -
Try this ...
lcduMail.CreateMessage(SenderName,SenderAddress,Recipients,Subject,Body,TRUE) lcduMail.AddAttachment('c:\MyPicture.jpg'); lcduMail.AppendBody('<img src="cid:MyPicture.jpg">'); lcduMail.Send;0 -
Thanks, it was working just the way I wished and without additional OCX or automations
0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 329 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions