Alaska Software Inc. - sending a HTML email
Username: Password:
AuthorTopic: sending a HTML email
Manfred Schipflingersending a HTML email
on Wed, 23 Jan 2002 14:22:30 +0100
Hello all,

does anybody know how a HTML email can
be sent with the ASINET library?

Setting a other Content-Type with
oMail:setContentType( 'text/html; charset="iso-8859-1"' )
don't work. (please see my TEST.PRG)

I want send a email in text/plain and text/html
like MS Outlook Express
but making a multipart message
for sending is not possible with
ASINET.

Thank you for information.

Manfred
Thaler EDV-Systeme GmbH
Austria





Test.prg
Andreas Gehrs-Pahl Re: sending a HTML email
on Wed, 23 Jan 2002 15:20:33 +0100
Manfred,

>I want send a email in text/plain and text/html like MS Outlook Express
>but making a multipart message for sending is not possible with ASINET.

Sorry, I can't help you with the "how", but I would like to know about the 
"why". I think that sending those additional HTML copies (or HTML emails in 
general) are one of the most annoying (email) things, right after spam. They 
are also a security issue, and nobody should even use HTML-enabled email 
programs, if you ask me.

So, why do you want to send those additional (bandwidth-eating) HTML copies?

Curiously,

-- Andreas 

---                                                                       ---
  Andreas Gehrs-Pahl              E-Mail: GPahl@wazoo.com
  415 Gute Street                     or: GPahl@chartermi.net
  Owosso, MI 48867-4410               or: Andreas@Aerospace-History.net
  Tel: (989) 723-9927           Web Site: http://www.Aerospace-History.net
---                                                                       ---
Manfred SchipflingerRe: sending a HTML email
on Thu, 24 Jan 2002 09:11:07 +0100
Andreas,

the "why" is simple:
sometimes a email must have a better look as
a ascii - email, for example: offers and so on.
We have a email-server software for our
customers. And the problem is:
if you (we) must say to your (our) customer -
"sorry, the software can't handle this" (in this case
the hrml-email) the customer say back - "bad
software". But you can say "yes, the software can
this" everything is ok for the customer.

You are right that a html-email is a higher security
problem. But we are a serious company and we
are not sending email-spam or other things.
And i think that the most private users of email
client-software have enabled the HTML because
they don't know about this security problem.
And the default setting of HTML-email
in MS Outlook (Express) is "enabled"!

Ok, this is my "why",
so i want information about the "how" again.

Thank you very much.

Manfred
Thaler EDV-Systeme GmbH
Austria


"Andreas Gehrs-Pahl" <gpahl@wazoo.com> schrieb im Newsbeitrag
news:3c4ec6b0@asgcom.alaska-software.com...
> Manfred,
>
> >I want send a email in text/plain and text/html like MS Outlook Express
> >but making a multipart message for sending is not possible with ASINET.
>
> Sorry, I can't help you with the "how", but I would like to know about the
> "why". I think that sending those additional HTML copies (or HTML emails
in
> general) are one of the most annoying (email) things, right after spam.
They
> are also a security issue, and nobody should even use HTML-enabled email
> programs, if you ask me.
>
> So, why do you want to send those additional (bandwidth-eating) HTML
copies?
>
> Curiously,
>
> -- Andreas
>
> ---                                                                       
---
>   Andreas Gehrs-Pahl              E-Mail: GPahl@wazoo.com
>   415 Gute Street                     or: GPahl@chartermi.net
>   Owosso, MI 48867-4410               or: Andreas@Aerospace-History.net
>   Tel: (989) 723-9927           Web Site: http://www.Aerospace-History.net
> ---                                                                       
---
phil@idep.org.uk Re: sending a HTML email
on Thu, 24 Jan 2002 09:22:44 +0000
>>I want send a email in text/plain and text/html like MS Outlook Express
>>but making a multipart message for sending is not possible with ASINET.
>
>Sorry, I can't help you with the "how", but I would like to know about the 
>"why". I think that sending those additional HTML copies (or HTML emails in 
>general) are one of the most annoying (email) things, right after spam. They 
>are also a security issue, and nobody should even use HTML-enabled email 
>programs, if you ask me.

Well, I agree, but here at the ISTD we send out a newsletter to the
members regularly.  The newsletter is in fact an electronic
mini-version of our magazine, so wants (desperately) to be in html so
it can be read on the maximum number of different systems.  Some of
our members do not have html-enabled e-mail clients (probably for the
same reasons as yourself), and therefore an alternate text-only
version is supplied.  Providing these as a multi-part rather than as a
text-based email with attachments means that 99% of the time their
reader displays the mail as best it can immediately without further
intervention of the user - an important consideration for a global
member list of disparate backgrounds, education and computer literacy.

Regards,

Phil Ide

Xbase++ FAQ
current release: 7,  Monday 21st January 2002, 09:03am 
***
* Xbase++ FAQ:
*  online  : http://www.idep.org.uk/xbase/xbfaq/xbfaq.htm
*          : www.software-braun.de/xbfaq/xbfaq.htm 
*  download: http://www.idep.org.uk/xbase/xbfaq.zip
*          : www.software-braun.de/xbfaq/xbfaq.zip 
***

CERBERUS, n.  The watch-dog of Hades, whose duty it was to guard the 
entrance -- against whom or what does not clearly appear; everybody, 
sooner or later, had to go there, and nobody wanted to carry off the 
entrance.

 - the Devil's Dictionary, Ambrose Bierce
Wilbert SiebringRe: sending a HTML email
on Thu, 24 Jan 2002 09:24:34 +0100
Hi Manfred,

I had the same problem and couldn't find the answer in de ASINET lib
Its al about MIME.
So I just sended myself an HTML mail and looked at the way M$ outlook
created the email
and recreated it in Xbase.
Also you could check RFC :   www.ietf.org/rfc  1521 and 1522


Regards,

Wilbert Siebring
Dacom Automatisering
http://www.dacom.nl
Manfred SchipflingerRe: sending a HTML email
on Thu, 24 Jan 2002 12:04:38 +0100
Hi Wilbert,

> So I just sended myself an HTML mail and looked at the way M$ outlook
> created the email

I also have done the same and i looked at the source-code of
the html-email and it looks very difficult for me.

> and recreated it in Xbase.

How ??
Do you make the email as a string?
How do you send the html-email? With ASINET or
on the lower level over tcp/ip?

I dont't like the lower level, because i must be "smart"
in RFC, TCP/IP, SMTP-protocoll and so on.

Many thanks for information.

Manfred
Thaler EDV-Systeme GmbH
Austria
Wilbert SiebringRe: sending a HTML email
on Mon, 28 Jan 2002 08:30:12 +0100
Manfred,

> Do you make the email as a string?
No, I write it first to a file.
> How do you send the html-email? With ASINET or
> on the lower level over tcp/ip?

I use lowlevel tcp/ip, because I had use it  before there was ASINET.

Here's an example
--------------------------
cBound:="DACOM_BOUNDARY_AAA"
nH1:=fcreate(''temp.tmp")
fwrite(nH1,"Date: "+maildate(date(),time())+CRLF)
fwrite(nH1,"From: "+cFrom+CRLF)
fwrite(nH1,"To: "+cTo+CRLF)
fwrite(nH1,"Subject: "+cSubj+CRLF)
fwrite(nH1,"X-Mailer: Dacom Mailshaker"+CRLF)
fwrite(nH1,"Mime-Version: 1.0"+CRLF)
fwrite(nH1,'Content-Type: multipart/related; boundary='+cBound+';
type="text/html"'+CRLF+CRLF)
fwrite(nH1,"This is a multi-part message in MIME format."+CRLF)
fwrite(nH1,"--"+cBound+CRLF)
fwrite(nH1,'Content-Type: text/html; charset="iso-8859-1"'+CRLF)
fwrite(nH1,'Content-Transfer-Encoding: 7bit'+CRLF)
//fwrite(nH1,"Content-Transfer-Encoding: quoted-printable"+CRLF)
fwrite(nH1,CRLF)

fwrite(nH1,cStr)    <=== this is the html data.......

fwrite(nH1,CRLF+CRLF)
for t=1 to len(aImg)   aImg is an array with the images in the html data
   fwrite(nH1,"--"+cBound+CRLF)
   fwrite(nH1,'Content-Type: image/gif'+CRLF)

   //; name="'+aImg[t]+'"'+CRLF)

   fwrite(nH1,'Content-ID: <plaatjenr'+alltrim(str(t,2))+'@dacom>'+CRLF)
   fwrite(nH1,"Content-Transfer-Encoding: base64"+CRLF)
   fwrite(nH1,'Content-Disposition: inline; filename="'+aImg[t]+'"'+CRLF)
   fwrite(nH1,CRLF)
   nH:=fopen(cPad+aImg[t])
   i:=1
   while .t.
      cBuf:=space(3)
      nRead:=fread(nH,@cBuf,len(cBuf))
      devout('.')
      if nRead<=0
         exit
      endif
      cRet:=Base64Encrypt(left(cBuf,nRead))
      fwrite(nH1,cRet)
      i++
      if i>19
         fwrite(nH1,CRLF)
         i:=1
      endif
   end
   fclose(nH)
   fwrite(nH1,CRLF)
next
fwrite(nH1,'--'+cBound+'--'+CRLF)
fwrite(nH1,CRLF)
fclose(nH1)

-------------------------------

Regards,

Wilbert Siebring
Dacom Automatisering
http://www.dacom.nl
Manfred SchipflingerRe: sending a HTML email
on Mon, 28 Jan 2002 09:00:34 +0100
Thank you for your example.
I see - this is lowlevel tcp/ip, MIME, ...

On Friday i got a new ASINET10.DLL for Xbase 1.7 from Alaska
and with those DLL it is possible to change the
Content-type of a email to "text/html".
So it is possible to send a single-part "text/html" email with
ASINET. But i have tested with a very simple HTML-text.
I don't know if images and so on in a HTML-email also
work correct.

Manfred
Thaler EDV-Systeme GmbH
Austria
Anand GuptaRe: sending a HTML email
on Thu, 31 Jan 2002 12:28:10 +0530
Hi Wilbert,

Where can I find following externals, to test your codes ?

MAILDATE()
BASE64ENCRYPT()

Anand

"Wilbert Siebring" <wilbert@dacom.nl> wrote in message
news:3c54fcbf$1@asgcom.alaska-software.com...
> Manfred,
>
> > Do you make the email as a string?
> No, I write it first to a file.
> > How do you send the html-email? With ASINET or
> > on the lower level over tcp/ip?
>
> I use lowlevel tcp/ip, because I had use it  before there was ASINET.
>
> Here's an example
> --------------------------
> cBound:="DACOM_BOUNDARY_AAA"
> nH1:=fcreate(''temp.tmp")
> fwrite(nH1,"Date: "+maildate(date(),time())+CRLF)
> fwrite(nH1,"From: "+cFrom+CRLF)
> fwrite(nH1,"To: "+cTo+CRLF)
> fwrite(nH1,"Subject: "+cSubj+CRLF)
> fwrite(nH1,"X-Mailer: Dacom Mailshaker"+CRLF)
> fwrite(nH1,"Mime-Version: 1.0"+CRLF)
> fwrite(nH1,'Content-Type: multipart/related; boundary='+cBound+';
> type="text/html"'+CRLF+CRLF)
> fwrite(nH1,"This is a multi-part message in MIME format."+CRLF)
> fwrite(nH1,"--"+cBound+CRLF)
> fwrite(nH1,'Content-Type: text/html; charset="iso-8859-1"'+CRLF)
> fwrite(nH1,'Content-Transfer-Encoding: 7bit'+CRLF)
> //fwrite(nH1,"Content-Transfer-Encoding: quoted-printable"+CRLF)
> fwrite(nH1,CRLF)
>
> fwrite(nH1,cStr)    <=== this is the html data.......
>
> fwrite(nH1,CRLF+CRLF)
> for t=1 to len(aImg)   aImg is an array with the images in the html data
>    fwrite(nH1,"--"+cBound+CRLF)
>    fwrite(nH1,'Content-Type: image/gif'+CRLF)
>
>    //; name="'+aImg[t]+'"'+CRLF)
>
>    fwrite(nH1,'Content-ID: <plaatjenr'+alltrim(str(t,2))+'@dacom>'+CRLF)
>    fwrite(nH1,"Content-Transfer-Encoding: base64"+CRLF)
>    fwrite(nH1,'Content-Disposition: inline; filename="'+aImg[t]+'"'+CRLF)
>    fwrite(nH1,CRLF)
>    nH:=fopen(cPad+aImg[t])
>    i:=1
>    while .t.
>       cBuf:=space(3)
>       nRead:=fread(nH,@cBuf,len(cBuf))
>       devout('.')
>       if nRead<=0
>          exit
>       endif
>       cRet:=Base64Encrypt(left(cBuf,nRead))
>       fwrite(nH1,cRet)
>       i++
>       if i>19
>          fwrite(nH1,CRLF)
>          i:=1
>       endif
>    end
>    fclose(nH)
>    fwrite(nH1,CRLF)
> next
> fwrite(nH1,'--'+cBound+'--'+CRLF)
> fwrite(nH1,CRLF)
> fclose(nH1)
>
> -------------------------------
>
> Regards,
>
> Wilbert Siebring
> Dacom Automatisering
> http://www.dacom.nl
>
>
>
Wilbert SiebringRe: sending a HTML email
on Thu, 31 Jan 2002 08:31:52 +0100
Anand,


> Where can I find following externals, to test your codes ?

****************************************************************************
***
function maildate(dDatum,cTijd)
****************************************************************************
***
//Wed, 04 Apr 2000 04:01:00 +0200
return left(cdow(dDatum),3)+", "+strzero(day(dDatum),2)+" "+;
       left(cMonth(dDatum),3)+" "+str(year(dDatum),4)+" "+cTijd+" +0000"

> BASE64ENCRYPT()

I wrote a C function for the base64 encoding
I attached the dll.


****************************************************************************
***
Function Base64Encrypt(cToCode)
****************************************************************************
***
local cRet:=space(4)
local nDll:=dllload('dcmmime.dll')
DllCall(nDll,32,"Encode64",@cToCode,@cRet)
return cRet

Regards,

Wilbert Siebring
Dacom Automatisering
http://www.dacom.nl





dcmmime.dll
Anand GuptaRe: sending a HTML email
on Thu, 31 Jan 2002 14:51:20 +0530
Thanx Wilbert

Will get back to you, after testing

Anand

"Wilbert Siebring" <wilbert@dacom.nl> wrote in message
news:3c58f1c2@asgcom.alaska-software.com...
> Anand,
>
>
> > Where can I find following externals, to test your codes ?
>
>
****************************************************************************
> ***
> function maildate(dDatum,cTijd)
>
****************************************************************************
> ***
> //Wed, 04 Apr 2000 04:01:00 +0200
> return left(cdow(dDatum),3)+", "+strzero(day(dDatum),2)+" "+;
>        left(cMonth(dDatum),3)+" "+str(year(dDatum),4)+" "+cTijd+" +0000"
>
> > BASE64ENCRYPT()
>
> I wrote a C function for the base64 encoding
> I attached the dll.
>
>
>
****************************************************************************
> ***
> Function Base64Encrypt(cToCode)
>
****************************************************************************
> ***
> local cRet:=space(4)
> local nDll:=dllload('dcmmime.dll')
> DllCall(nDll,32,"Encode64",@cToCode,@cRet)
> return cRet
>
> Regards,
>
> Wilbert Siebring
> Dacom Automatisering
> http://www.dacom.nl
>
>
>
>
Ricardo Dez AntequeraRe: sending a HTML email
on Mon, 28 Jan 2002 11:54:42 +0100
I havent tried it yet but, according to the information in their website,
the free version of Funcky for Xbase++ (FunckyLite) includes a SMTP client
that allows you to send a HTML email with an alternative text content. You
can check it at www.funcky.com.

HTH,

--

Un saludo,

Ricardo Dez Antequera (rda@lmdata.es)
Director de Informtica
L&M Data Communications
http://www.LMdata.es/

"Manfred Schipflinger" <thaleredv@aon.at> escribi en el mensaje
news:3c4eb69b$1@asgcom.alaska-software.com...
> Hello all,
>
> does anybody know how a HTML email can
> be sent with the ASINET library?
>
> Setting a other Content-Type with
> oMail:setContentType( 'text/html; charset="iso-8859-1"' )
> don't work. (please see my TEST.PRG)
>
> I want send a email in text/plain and text/html
> like MS Outlook Express
> but making a multipart message
> for sending is not possible with
> ASINET.
>
> Thank you for information.
>
> Manfred
> Thaler EDV-Systeme GmbH
> Austria
>
>
>
>
Reinthaler RudolfRe: sending a HTML email
on Mon, 04 Feb 2002 12:13:30 +0100
Hello Manfred,
I am using Funcky for this purpose. It's really easy to use. Here my code:

function csendmail(cPAdress,cPName,cPText)
******************************************************************
LOCAL FUNCky,Smtp,cServer := space(30),aInetvar,x,lRet := .t.
LOCAL cEmailAddress, cAttachment, cText,
cSubject,cEmailFromName,cEmailFromAdr

cEmailAddress  := cPAdress                           an Email-Adresse
cEmailName     := cPName                             an Name
cEmailFromName := "Test"                       Absender Name
cEmailFromAdr  := "xxxx@xxxx.at"             Absender Emailadresse
cSubject       := "Testmail"                      
cAttachment    := ""                                
cText          := cPText

cText          := ascrepl(cText,2)
cSubject       := ascrepl(cSubject,2)
cEmailFromName := ascrepl(cEmailFromName,2)

nTimeout       := 20000// IPAR_TIMEOUT               Timeout
cServer        := "mail.xxx.com"                    Mailserver
if nTimeout = 0
     nTimeout := 20000
endif
*------------------------------------------------------------
Smtp := FUNCkySMTP():New()
<Smtp:Server      := cServer>
<Smtp:Timeout     := nTimeout>
<Smtp:FromName    := cEmailFromName>
<Smtp:FromAddress := cEmailFromAdr>
<Smtp:Subject     := cSubject>
<Smtp:HTML        := cText>
<Smtp:ToAddress   := cEmailAddress>  mehrere koennen mit "," getrennt
werden
<Smtp:ToName      := cEmailName>
<Smtp:Attachments := cAttachment>

If <Smtp:Send()>
     alert("Erfolgreich an " + cEmailAddress + " " + cEmailName +  "
verschickt " + dtoc(date()) + "/" + time())
else
     cError := getstatus(<smtp:error>)
     alert("!!! Fehler beim Senden des Passwortes an " + cEmailAddress + " "
+ cEmailName +  " " + dtoc(date()) + "/" + time())
     alert("    Fehler#" + ntrim(<Smtp:error>) + "-" + <Smtp:ErrorMessage> )
     return cError
endif
*------------------------------------------------------------
return ""


greetings from Salzburg
Rudolf


"Manfred Schipflinger" <thaleredv@aon.at> schrieb im Newsbeitrag
news:3c4eb69b$1@asgcom.alaska-software.com...
> Hello all,
>
> does anybody know how a HTML email can
> be sent with the ASINET library?
>
> Setting a other Content-Type with
> oMail:setContentType( 'text/html; charset="iso-8859-1"' )
> don't work. (please see my TEST.PRG)
>
> I want send a email in text/plain and text/html
> like MS Outlook Express
> but making a multipart message
> for sending is not possible with
> ASINET.
>
> Thank you for information.
>
> Manfred
> Thaler EDV-Systeme GmbH
> Austria
>
>
>
>
Manfred SchipflingerRe: sending a HTML email
on Tue, 05 Feb 2002 08:25:14 +0100
Hello Rudolf,

> I am using Funcky for this purpose. It's really easy to use. Here my code:

thank you very much - i take a look on it.

Greetings from Kundl/Tirol
Manfred