FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour DEFINE MAIL .... HTML
Posts: 708
Joined: Fri Oct 28, 2005 09:53 AM
DEFINE MAIL .... HTML
Posted: Mon Aug 15, 2011 03:38 PM

Hello,

Is it possible to use DEFINE MAIL and create HTML body in TEXT? I am using FWH 8.10.

DEFINE MAIL oMail ;
SUBJECT cSubject ;
TEXT cText ;
FROM USER ;
RECEIPT

Thank you,

*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: DEFINE MAIL .... HTML
Posted: Mon Aug 15, 2011 03:57 PM

Darrell,

Don't use the TEXT. Create the HTML as a file, then specify the HTML file as an attachment, then it will appear as the body of the message.

Regards,
James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 708
Joined: Fri Oct 28, 2005 09:53 AM
Re: DEFINE MAIL .... HTML
Posted: Mon Aug 15, 2011 03:58 PM

Thank you James

*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
Posts: 708
Joined: Fri Oct 28, 2005 09:53 AM
Re: DEFINE MAIL .... HTML
Posted: Thu Aug 18, 2011 05:57 PM

Hi James,

I would like to attach a file in addition to HTML file. I am getting a MAPI error 11 (attachment not found). Using the following code.

AADD( aStmnAttach, { cFText, cFText } )
AADD( aStmnAttach, { PA[25] + cPdf + '.pdf', PA[25] + cPdf + '.pdf' } )

_email( cEmail, cSubject, '', aStmnAttach )

//--------------------------------------------------------------
function _email( cTo, cSubject, cText, aEmFile )

DEFINE MAIL oMail ;
TO ALLTRIM(cTo) ;
SUBJECT cSubject ;
FROM USER ;
RECEIPT ;
FILES cEmFile

*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
Posts: 417
Joined: Tue Feb 23, 2010 03:09 PM
Re: DEFINE MAIL .... HTML
Posted: Thu Aug 18, 2011 06:35 PM

Hello.

You have to use full path.

FWH 11.11, Harbour 3.1 and Borland C++ 5.82
Posts: 708
Joined: Fri Oct 28, 2005 09:53 AM
Re: DEFINE MAIL .... HTML
Posted: Thu Aug 18, 2011 06:42 PM

Hello,

Thank you, the values contain the full path...

AADD( aStmnAttach, { cFText, cFText } ) ---------------------------------------------------> c:\upload\test.htm
AADD( aStmnAttach, { PA[25] + cPdf + '.pdf', PA[25] + cPdf + '.pdf' } ) -----------------> c:\upload\A0001.pdf

*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: DEFINE MAIL .... HTML
Posted: Thu Aug 18, 2011 09:31 PM

Darrell,

I have never tried both an HTML and another type of attachment at the same time. Have you tried two non-html attachments using your code? Does that work?

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 708
Joined: Fri Oct 28, 2005 09:53 AM
Re: DEFINE MAIL .... HTML
Posted: Thu Aug 18, 2011 09:43 PM

Hi James,

Yes, with a single attachment it works fine. Perhaps there is a limitation of one attachment?

Sincerely,

*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: DEFINE MAIL .... HTML
Posted: Fri Aug 19, 2011 12:08 AM
Darrell,

My question was, "Have you tried two non-html attachments using your code? Does that work?"

You might also try putting the PDF first and the HTML last. Just an idea...

James
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10

Continue the discussion