HTML in Body Email

angelsgepe
Member Posts: 4
Hi everyone,
I want to send an email with a html file in the body.
I created the html file with a function of the report but I don't know what can I do to attach the html as a BODY email.
Thanks!!!
Angels
I want to send an email with a html file in the body.
I created the html file with a function of the report but I don't know what can I do to attach the html as a BODY email.
Thanks!!!
Angels
0
Comments
-
What E-mail Automation are you using?0
-
You can send e-mails in Navision using many components. Can you tell witch components you are using? It’s standard object to send e-mails in NAV 5?0
-
nunomaia wrote:You can send e-mails in Navision using many components. Can you tell witch components you are using? It’s standard object to send e-mails in NAV 5?
I wasn't asking him/her to help me out. I was asking because different components allow/disallow HTML formating and require different properties to be called with different values that may not be obvious.angelsgepe wrote:Hi everyone,
I want to send an email with a html file in the body.
I created the html file with a function of the report but I don't know what can I do to attach the html as a BODY email.
Thanks!!!
Angels
If I may suggest, you might want to look into using a PDF "printer" (PDFCreator is a good one) to convert your reports to PDF and attach to your emails. (So that the report being sent retains its format and doesn't get all misaligned and nasty looking.)
(PDFCreator Example shown by ara3n: http://www.mibuso.com/forum/viewtopic.php?t=18331&highlight=)0 -
Hi!!!
I cann't attach the file. I must put it in the body.
I'm using the standard components in Navision to do this.
Thank you very much,
Angels0 -
So you're using CodeUnit: 397 (NAV<=4) or 400 (NAV5) ?0
-
Hi,
I don't use anything yet because I don't know what can I do this.
Thanks,
Angels0 -
Use NAV5.0's "Microsoft Navision Mail.DLL" automation.
Just use code to read from the HTML file and place the input data into the body of the e-mail as well as setting...[MnmdllVarName].HtmlFormatted := TRUE;
0 -
Variables:
objApp : Automation : 'Microsoft Outlook 11.0 Object Library'.Application
objMail : Automation : 'Microsoft Outlook 11.0 Object Library'.MailItem//Create application IF ISCLEAR(objApp) THEN CREATE(objApp); //Create mail item objMail := objApp.CreateItem(0); // set properties objMail."To"('someone@somewhere.com'); objMail.Subject('Tienes correo'); objMail.HTMLBody(' whatever html string you want to put here... '); //Uncomment for display email //objMail.Display(); //Send mail objMail.Send();
you have to have outlook to use this code.
code shamelessly stolen from
http://tricksnavision.blogspot.com/0 -
Hi Reinhard,
This is a very simple way of sending the HTML contents using Outlook. I have been breaking my head for more than a week to solve this. Thanks for the solution.
But, Still i face a problem. I have converted a report to html. I am trying to read the Html file and passing the Html code to
'objMail.HTMLBody'. But, i have no way of adding more than 1024 characters as i am not able to use BigText or Array or Instream. I dont find any way of adding more Html lines.
Is there any workaround for this? :-k
Thanks
Libin D0 -
For some reason my Microsoft Outlook 11.0 Object isn't registered so I am unable to attempt any tests at the time (nor do I have the time to get it to work.)
Take a look at http://www.mibuso.com/forum/viewtopic.php?t=5496
There is some example code with using a different automation. One that clearly shows the use of a function to append lines to the current body. (BSTRConverterBody in specific.)0 -
I have recently done something similar using SMTP OCX.
It works with Outlook and Non-Outlook email clients as SMTP is a sort of standard.
You can use HTML in the message like use tables, bold italic etc.
The SMTP OCX is available from the download section in this forum.
If you need anything else, I will try and help.0 -
Hi there,
Thanks for the quick responses.
I did change the body type to HTML & other stuffs. But still i cannot get it work.
All my begin tag(ie. '<' ) and end tag (ie. '>') are converted to > and < notation when i use the 'AddBodyline() method.
And I am not able to figure out a way to pass more than 1024 characters if i use Mailitem.HtmlBody
Does anybody have an idea?
Thanks & Regards,
LIBIN D.0 -
Is their any posibility to attach the file in outlook object library mail item.
-sankar ganesh0 -
IF ISCLEAR(MSOLOApp) THEN CREATE(MSOLOApp); MSOLOMailItem := MSOLOApp.CreateItem(0); MSOLOAttachments := MSOLOMailItem.Attachments; MSOLOMailItem."To" := 'email@emailaddress.com'; MSOLOAttachments.Add('C:\Documents And Settings\sganesh\Desktop\test.txt'); MSOLOMailItem.Send;
Only problem is, you will get the Allow/Deny pop-up dialog every time you try to send an e-mail. (Unless there is a way to remove this, I'm not quite sure)0 -
Reinhard wrote:Variables:
objApp : Automation : 'Microsoft Outlook 11.0 Object Library'.Application
objMail : Automation : 'Microsoft Outlook 11.0 Object Library'.MailItem//Create application IF ISCLEAR(objApp) THEN CREATE(objApp); //Create mail item objMail := objApp.CreateItem(0); // set properties objMail."To"('someone@somewhere.com'); objMail.Subject('Tienes correo'); objMail.HTMLBody(' whatever html string you want to put here... '); //Uncomment for display email //objMail.Display(); //Send mail objMail.Send();
you have to have outlook to use this code.
code shamelessly stolen from
http://tricksnavision.blogspot.com/
I have used the same code but it does not send the HTML body into my Gmail account or other.
My CODE in Nav
// Automation Start
//Create application
IF ISCLEAR(objApp) THEN CREATE(objApp);
//Create mail item
objMail := objApp.CreateItem(0);
// set properties
objMail."To"('navuser1@gmail.com');
objMail.Subject('Important');
objMail.BodyFormat:=2;
objMail.HTMLBody :='<a href='+Text101+'>navuser1</a>';
//Uncomment for display email
objMail.Display();
//Send mail
objMail.Send();
// Automation End;
Text101 :=CurrForm.URL;Now or Never0 -
Hi,
I need to mail an e-Mail with a HTML body two, but i also need to change the send address (the customer wants to send the mails from its "info@domain.com"-Address instead of the current usernames (like "john.doe@domain.com") i saw that the mail automation has a function called "sendusingaccount" but it requires an account object and i don't know how to set the account-object for this task.
edit: [solved]
i just found out i overlooked the function "SentOnBehalfOfName" which works just fine for me.
regards
stli0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K 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
- 320 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