Function MailText

Knowledge exchange related to the VPE Report Engine and PDF Library

Moderator: IDEAL Software Support

Function MailText

Postby alanguille » Fri Oct 27, 2006 2:03 pm

I would like to know if it was possible to improve the apparence of e-mail text by adding bold, different colors and underlining parts of this text. I didn't find anything about that in the documentation. If any of you knows a way to do it or if it is planned in next releases of VPE, thanks to let me know.
alanguille
 
Posts: 15
Joined: Fri Oct 27, 2006 1:51 pm

Postby IDEAL Software Support » Fri Oct 27, 2006 6:23 pm

Just an idea, but we haven't tried it:

Instead of providing plain text to the e-mail function, provide fully formed HTML code (starting with the <html> and <head> tags, etc.).

I am interested if this works, please let us know here in the forum.

Regards
Thorsten Radde
IDEAL Software GmbH
IDEAL Software Support
 
Posts: 1633
Joined: Thu Nov 18, 2004 4:03 pm

Postby alanguille » Mon Oct 30, 2006 9:56 am

I tried it, but the html code was still considered as text format, and I could see my tags in the message body.
alanguille
 
Posts: 15
Joined: Fri Oct 27, 2006 1:51 pm

Postby IDEAL Software Support » Mon Oct 30, 2006 3:05 pm

We searched and found some additional information, and the next major version of VPE will allow to write HTML code (or even RTF) to e-mails. In the current version this is not possible. The new version will be released - at least as beta - in a few months.

Regards
Thorsten Radde
IDEAL Software GmbH
IDEAL Software Support
 
Posts: 1633
Joined: Thu Nov 18, 2004 4:03 pm

Postby alanguille » Mon Oct 30, 2006 3:13 pm

Thanks for your answer. We will wait for the next version, this functionnality will be greatly appreciated.
alanguille
 
Posts: 15
Joined: Fri Oct 27, 2006 1:51 pm

Postby IDEAL Software Support » Mon Oct 30, 2006 3:19 pm

We made some further tests. At least with Thunderbird 1.5 we can already send HTML message bodies with the current version v3.60 of VPE.

We used the following code:
Code: Select all
   VpeSetMailText(hDoc,
      "<html>"
      "<head>"
      "<meta content=\"text/html; charset=ISO-8859-1\" http-equiv=\"content-type\">"
      "<title>titel</title>"
      "</head>"
      "<body>"
      "hello <big><big><span "
      "style=\"font-weight: bold; font-style: italic;\">World</span></big></big>, how are you?<br><br>"
      "Thanks<br>"
      "Bye"
      "</body>"
      "</html>");


Regards
Thorsten Radde
IDEAL Software GmbH
IDEAL Software Support
 
Posts: 1633
Joined: Thu Nov 18, 2004 4:03 pm

Postby alanguille » Mon Oct 30, 2006 3:47 pm

I made the same test with Outlook 2002 : the text remained in 'text only' mode, Outlook didn't recognized it as HTML format.
Thunderbird 1.5 may switch automatically in html format when he sees the <html> tag.
alanguille
 
Posts: 15
Joined: Fri Oct 27, 2006 1:51 pm

Postby IDEAL Software Support » Mon Oct 30, 2006 6:36 pm

Yes, too bad that Outlook does not simply check for the <HTML> tag and then switches over to HTML messaging.

However, we found a solution. It is tested with our development branch, but should also work with the current v3.60 - please let us know.

The trick is to set the mail text empty and to attach an html file which will then become the message body.

MailText = "" (empty, this is important!)
ClearMailAttachments()
AddMailAttachment("c:\\test.html", "bla.html")

We tested it with Outlook 2003 as well as with Outlook Express and it works for both.

Regards
Thorsten Radde
IDEAL Software GmbH
IDEAL Software Support
 
Posts: 1633
Joined: Thu Nov 18, 2004 4:03 pm

Postby alanguille » Tue Oct 31, 2006 10:23 am

I tested it with VPE 3.60 and Outlook 2002 and it is working fine (excepted an horizontal row added automatically by Outlook).
But if we attach more than one file in the same time, like the html file and a .vpe file, the html file is no more in the message body.
In our application we are sending several files in the same time and we don't know the messaging software of the receiver, then I think the only solution for us will be to have a function or a way to set up the mode of mailtext to HTML or RTF, instead of Text only.
Thanks for your help
alanguille
 
Posts: 15
Joined: Fri Oct 27, 2006 1:51 pm

Postby IDEAL Software Support » Tue Oct 31, 2006 12:53 pm

Unfortunately we can not implement a feature - as announced earlier in this thread - to specify HTML text. We thought we could do, but we tested with Thunderbird. Later we found out that Thunderbird itself switches to HTML by analyzing the message body. Our code had no impact.

Outlook and Outlook Express do not analyze the message body and Simple MAPI does not provide any methods or flags to specify that a message body is HTML, RTF or something other.

So the only three options you have is:
1) Use plain text only
2) Attach an HTML file and no other attachments
3) Use Thunderbird

Regards
Thorsten Radde
IDEAL Software GmbH
IDEAL Software Support
 
Posts: 1633
Joined: Thu Nov 18, 2004 4:03 pm


Return to VPE Open Forum

Who is online

Users browsing this forum: No registered users and 11 guests

cron