mibuso.com

Microsoft Business Solutions online community
It is currently Sun May 26, 2013 11:08 am

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 17 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: HTML in Body Email
PostPosted: Wed Apr 23, 2008 5:28 pm 
Offline

Joined: Wed Apr 23, 2008 4:52 pm
Posts: 3
Location: Barcelona
Country: Spain (es)
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


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 23, 2008 5:37 pm 
Offline

Joined: Mon Mar 24, 2008 3:57 pm
Posts: 277
Location: Virginia
What E-mail Automation are you using?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 24, 2008 12:53 am 
Offline

Joined: Fri Aug 08, 2003 5:22 pm
Posts: 1147
Location: Lisbon
Country: Portugal (pt)
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?

_________________
Nuno Maia
Blog


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 24, 2008 1:48 am 
Offline

Joined: Mon Mar 24, 2008 3:57 pm
Posts: 277
Location: Virginia
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. :mrgreen:


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=)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 24, 2008 9:57 am 
Offline

Joined: Wed Apr 23, 2008 4:52 pm
Posts: 3
Location: Barcelona
Country: Spain (es)
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,

Angels


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 24, 2008 3:31 pm 
Offline

Joined: Mon Mar 24, 2008 3:57 pm
Posts: 277
Location: Virginia
So you're using CodeUnit: 397 (NAV<=4) or 400 (NAV5) ?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 24, 2008 9:34 pm 
Offline

Joined: Wed Apr 23, 2008 4:52 pm
Posts: 3
Location: Barcelona
Country: Spain (es)
Hi,

I don't use anything yet because I don't know what can I do this.

Thanks,

Angels


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 25, 2008 9:29 pm 
Offline

Joined: Mon Mar 24, 2008 3:57 pm
Posts: 277
Location: Virginia
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...

Code: Select all
[MnmdllVarName].HtmlFormatted := TRUE;


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 26, 2008 12:56 am 
Offline

Joined: Sat Mar 29, 2008 1:19 am
Posts: 206
Location: California
Country: United States (us)
Variables:
objApp : Automation : 'Microsoft Outlook 11.0 Object Library'.Application
objMail : Automation : 'Microsoft Outlook 11.0 Object Library'.MailItem


Code: Select all
//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/


Top
 Profile  
 
 Post subject: HTML in Body Email
PostPosted: Mon Apr 28, 2008 9:45 am 
Offline

Joined: Thu Oct 11, 2007 11:34 am
Posts: 17
Location: Chennai
Country: India (in)
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 D


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 28, 2008 4:15 pm 
Offline

Joined: Mon Mar 24, 2008 3:57 pm
Posts: 277
Location: Virginia
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.)


Last edited by Xypher on Mon Apr 28, 2008 4:41 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 28, 2008 4:29 pm 
Offline

Joined: Thu Mar 06, 2008 2:31 pm
Posts: 36
Location: Europe
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.


Top
 Profile  
 
 Post subject: HTML in Body Email
PostPosted: Mon May 05, 2008 3:09 pm 
Offline

Joined: Thu Oct 11, 2007 11:34 am
Posts: 17
Location: Chennai
Country: India (in)
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 &gt; and &lt; 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.


Top
 Profile  
 
 Post subject: Outlook object library mail item file attachment
PostPosted: Tue May 06, 2008 7:06 pm 
Offline

Joined: Mon Aug 16, 2004 10:56 am
Posts: 7
Location: Chennai
Country: India (in)
Is their any posibility to attach the file in outlook object library mail item.

-sankar ganesh


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 06, 2008 7:33 pm 
Offline

Joined: Mon Mar 24, 2008 3:57 pm
Posts: 277
Location: Virginia
Code: Select all
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)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 17 posts ]  Go to page 1, 2  Next

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: fahd and 13 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum


Search for:
Jump to: