HTML Mail

Knowledge exchange related to the VPE Report Engine and PDF Library

Moderator: IDEAL Software Support

HTML Mail

Postby Frigyes » Thu Feb 21, 2013 12:21 am

Hallo again...

I try to send a mail with html in the body

Code: Select all

   if ( VpeGetMAPIType(hDoc) != 1 ) return false;  // not Extended MAPI

     VpeSetMailText(hDoc,
     "<html>"
      "<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>");

    VpeSetMailWithDialog(hDoc, true);

   return true;


but this not works...

Outlook 2007, VPE Prof 6.1

TIA

Regards
Frigyes
Frigyes
 
Posts: 26
Joined: Thu Jun 29, 2006 12:09 pm

Re: HTML Mail

Postby IDEAL Software Support » Mon Feb 25, 2013 11:54 am

The following is working here:

Code: Select all
VpeSetMailText(hDoc, "<html><body><span style='font-size:10.0pt;font-family:Arial;color:red'>Body <b>fat <i>italic</i></span> fat</b> text</body></html>");


Tested on Win 7, 64-bit, Outlook 2003, using Extended MAPI. We have no newer version of Outlook, we are not using it for our e-mail conversations. What Windows version and platform (x86 or x64) are you using? Are you sure you are using the latest service release of VPE (VPE v6.10 R1)?
IDEAL Software Support
 
Posts: 1621
Joined: Thu Nov 18, 2004 4:03 pm

Re: HTML Mail

Postby Frigyes » Tue Feb 26, 2013 11:39 pm

Hello!

I use VPE 6.10.1.7 X86 Win7

I try it on different PCs,

in most cases VpeGetMAPIType() returns 2 --> standard MAPI no HTML Mail;
with Mail Clients MS Office 2007 Outlook , or Lotus Notes

finally I found 1 PC in our network with installed Extended MAPI, but my testmail remains also on this, in Text-Mode

now I switched to blat.exe one command-line mailer, fine to send my VPE-Documents and works without MAPI

anyway thx for your answer...

Regards
Frigyes
Frigyes
 
Posts: 26
Joined: Thu Jun 29, 2006 12:09 pm

Re: HTML Mail

Postby IDEAL Software Support » Fri Mar 01, 2013 8:33 am

We would like to understand the cause of the problem.

What message store / server are you using (Exchange, ...)? Or are your Outlook clients configured to use an ISP (Internet Service Provider) directly?

Are you able to send HTML mails when using Outlook standalone?
IDEAL Software Support
 
Posts: 1621
Joined: Thu Nov 18, 2004 4:03 pm

Re: HTML Mail

Postby Frigyes » Sun Mar 03, 2013 11:22 pm

Hello Again!

I use Outlook, with and without HTML,
I have no problems with other Mail programs

to ex. I tested my extended Mapi with:
http://www.codeproject.com/Articles/108 ... PI-Wrapper

all functions works as excepted.


and now I can also send HTML mail with VPE,
but only with the old DLL Version: 6.1.0 Build: 6508


If I use the new DLL 6.1.1 Build 7041,
no chance to send a mail with HTML,
this always switch back to SIMPLE MAPI

where can we change the MAPI Type?

Regards
Frigyes
Frigyes
 
Posts: 26
Joined: Thu Jun 29, 2006 12:09 pm

Re: HTML Mail

Postby IDEAL Software Support » Mon Mar 04, 2013 12:03 pm

We had so many support incidents regarding problems with Extended MAPI - more than for any other topic - that we decided for R1 to set Simple MAPI as the default transport layer (please remember that versions prior to v6.0 did only provide Simple MAPI). The problems result from the messy design of the Windows MAPI subsystem. In addition there was 3rd party software replacing the MAIP DLLs and stuff like that, which caused failures.

As a result, in VPE v6.10 R1 only if Simple MAPI is not available on a machine, VPE selects Extended MAPI. We could not introduce a new method to select Extended MAPI by code, because R1 was a service release and had to be binary compatible to v6.0. The next release of VPE will provide a method to select the MAPI protocol by code. Due to the many problems with Extended MAPI, it might by wise to stick with Simple MAPI - except you can be 100% sure that the Extended MAPI subsystem on client machines is working without problems.
IDEAL Software Support
 
Posts: 1621
Joined: Thu Nov 18, 2004 4:03 pm

Re: HTML Mail

Postby Frigyes » Wed Mar 06, 2013 9:51 am


The following is working here:

Code: Select all
VpeSetMailText(hDoc, "<html><body><span style='font-size:10.0pt;font-family:Arial;color:red'>Body <b>fat <i>italic</i></span> fat</b> text</body></html>");


Tested on Win 7, 64-bit, Outlook 2003, using Extended MAPI.


have you also tested with ?

VpeSetMailWithDialog(hDoc, true);

Regards
Frigyes
Frigyes
 
Posts: 26
Joined: Thu Jun 29, 2006 12:09 pm

Re: HTML Mail

Postby IDEAL Software Support » Wed Mar 06, 2013 11:31 am

Yes, we tested it with the dialog and everything is displayed correctly.

Why are you asking?
IDEAL Software Support
 
Posts: 1621
Joined: Thu Nov 18, 2004 4:03 pm

Re: HTML Mail

Postby Frigyes » Wed Mar 06, 2013 5:35 pm

Hallo!

this is my code,

Code: Select all
VpeClearMailAttachments(hDoc);
VpeAddMailReceiver(hDoc,"support...",1 );
VpeSetMailText(hDoc, "<html><body><font size=2 color=red face=Arial><span style='font-size:10.0pt;font-family:Arial;color:red'>HTML Mail Body</font></body></html>");

if ( silent ) {
       VpeSetMailSubject(hDoc,"VPE Test...  (Dialog OFF)");
       VpeSetMailWithDialog(hDoc, false);
           }
   else {
      VpeSetMailSubject(hDoc,"VPE Test...  (Dialog ON)");
      VpeSetMailWithDialog(hDoc, true);
         };



I sent both e-mail directly to you,
only the silent mode changed true / false

Regards
Frigyes
 
Posts: 26
Joined: Thu Jun 29, 2006 12:09 pm

Re: HTML Mail

Postby IDEAL Software Support » Thu Mar 07, 2013 10:03 am

It would be nice, if you explain for other readers what is going on:
Your mail sent with the visible mail-compose dialog of Outlook is not in HTML.

We tested it here, and here it is using HTML. We sent you a sample mail to your mail account.

This can be a bug in Outlook or a configuration problem of Outlook / Exchange.
IDEAL Software Support
 
Posts: 1621
Joined: Thu Nov 18, 2004 4:03 pm

Re: HTML Mail

Postby IDEAL Software Support » Thu Mar 07, 2013 1:49 pm

We would like to add that problems like these are the reason, why we reverted back to use Simple MAPI as the default transport layer. The Simple MAPI and Extended MAPI subsystems of Windows are a mess - to say the least. For example, when testing this morning, the Send button of Outlook's mail-compose dialog did not work. We clicked onto the send button, it highlighted, but nothing happened. No error message, nothing which would indicate what could be wrong. The mail-compose dialog just stood there on the screen and nothing happened. But best of all: using the keyboard accelerator (hotkey) Alt-S, worked! There is no logical explanation for this. We used Google and found many many people with identical problems and several different solutions, like:

- Enable the option "send immediately when connected" in the Outlook configuration
- Delete a configuration file of Outlook named "outcmd.dat"
- Reinstall or repair the Outlook installation
- Delete the Outlook user account and create a new one
- Restart the computer

Nothing but the last option did help in our case. But what happened next? Immediately after restart of the PC we ran our test program and the mouse-click onto the send button worked, but then our test application crashed!!! Why? The error code indicates a crash or hang inside Outlook, so a COM call could not proceed. We verified with Task-Manager that Outlook was indeed hanging as a background process and killed it. Starting our test-program a second time with the debugger attached, it worked. So what? We don't know. Maybe we should have been waiting longer for the machine to initialize before starting our test program. Maybe cosmic radiation caused the problem (this is meant ironically).

From our experience with Simple MAPI and Extended MAPI, the whole design of the messaging subsystem of Windows is BAD. As many other things with Windows. Windows is neither designed nor programmed carefully. It is neither done with love, nor devotion or passion. We can judge that, because all the code of VPE is directly connected to the low-level API of Windows, and the problems we had to solve (by workarounds, which sometimes are really crazy - or maybe call it "creative") over all those years we are working on VPE were numerous. And they took a huge amount of working time - and therefore money. Bad design, bad documentation and malfunctioning code are normal for the Windows OS. And nothing got better with new versions. Microsoft does not fix basic problems, they do not carefully design their software, they do not innovate - they mainly copy ideas from competitors and their copies are bad. I have nothing good to say about Windows nor Microsoft.

Take for example Linux or any other *nix system: sending mail by code is one simple command. It is so easy, you can learn its use in one minute. Using Simple MAPI - and making it work - took weeks. Using Extended MAPI - and making it work - took months. (In both cases using pure C++, no C# or whatever layers that encapsulate and hide away all the pain of those bloated APIs.) And still Extended MAPI is causing so many problems that we were forced to revert back to Simple MAPI.
IDEAL Software Support
 
Posts: 1621
Joined: Thu Nov 18, 2004 4:03 pm

Re: HTML Mail

Postby IDEAL Software Support » Fri Mar 08, 2013 12:39 pm

Today we found out that when using Thunderbird (which only provides Simple MAPI), and specifying HTML text for the message (the same HTML text we used in the above example), Thunderbird will display and send it as HTML mail.
IDEAL Software Support
 
Posts: 1621
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