Function MailOutFile
local rrw,outfile,cAddr
rrw = form.rrwrunindatamodule1.rrwrunin1.rowset
outfile = rrw.fields["ri_outfile"].value
cAddr = "mailto:joh...@dohndoeland.com?subject=Reports"
ShellExecute(form.hwnd, 'open',cAddr, '', '', 1)
return
>I did a search of the news groups and could not find out how to add an
>attachment file to this function that I believe came from Ken. Can you
>offer some guidance? Also if you know how to add "Body" and "CC & BCC" it
>would be helpful.
Not me. If you're going to deal with attachments I think you've got
more work ahead of you.
Ken
---
Ken Mayer [dBASE, Inc.]
** Please respond ONLY in the newsgroups **
"Think OOP"
dBASE, Inc. website: http://www.dbase.com
mailto does not support attachents. Unforetunately, nothing you can do
(believe me, I've tried!). I have created an "email.cc" for the different
methods of email I support, the code for "mailto" is below. I did not write
this code (for the most part) and I can't remember who did, do I apologize
that I'm not giving proper credit for this. Please note that the message
text, including spaces and line breaks, first needs to be converted to
"web-safe" characters. In the code, "this.text" refers to the message body.
I'm sure you can figure out the others...
Hope this helps,
Jan
#define SW_SHOWNORMAL 1
#define WINAPI_SHELL "SHELL32"
#define WINAPI_A "A"
#define WINAPI_SHELL "SHELL32"
if type( "ShellExecute" ) # "FP"
extern cHandle ShellExecute( cHandle, cString, cString, ;
cString, cString, cINT ) WINAPI_SHELL ;
from "ShellExecute"+WINAPI_A
endif
mailtotext=""
for i=1 to len(this.text)
h1=subst(this.text,i,1)
if asc(h1)=32
h1="%20"
endif
if asc(h1)=13
h1="%0d"
endif
if asc(h1)=10
h1="%0a"
endif
mailtotext=mailtotext+h1
next i
mailstr = 'mailto:'+this.to+' ?Subject='+this.subject+'
&Body='+mailtotext
if len(trim(this.cc))>0
mailstr=mailstr+" &CC="+this.cc
endif
if len(trim(this.bcc))>0
mailstr=mailstr+" &BCC="+this.bcc
endif
*msgbox(mailstr)
ShellExecute(0, "open", mailstr, null, null, SW_SHOWNORMAL)
if this.attachments.size>0
msgbox("This email method does not support
attachments."+chr(13)+;
"Your attachment(s) were not transferred, you
will"+chr(13)+;
"need to add them manually.","Warning",48)
endif
------=_NextPart_000_00C4_01C27951.245928D0
Content-Type: application/pdf;
name="ANFAHRT.PDF"
Content-Disposition: attachment;
filename="ANFAHRT.PDF"
Content-Transfer-Encoding: base64
JVBERi0xLjMNJeLjz9MNCjE1IDAgb2JqDTw8IA0vTGluZWFyaXplZCAxIA0vTyAxNyANL0gg
WyAx
MDUyIDIwNyBdIA0vTCAzNzMxOSANL0UgMzYwMzYgDS9OIDEgDS9UIDM2OTAxIA0
+PiANZW5kb2Jq
...<middle part stripped>
ZuCkZBpPevAg9Cke0llvoQKTv0maU8Kb4pGno+KXsEekPEOomal8B1qXqMKlZ8l6E/Oojimb
22GQ
xVKp2MagmPpqQQAAOw==
------=_NextPart_000_00C4_01C27951.245928D0--
--
Romain Strieff [dBVIPS]
http://www.dbase.com/Docs/newsguid.htm
I see what you are saying. This might be a possibility, but I am not sure if
it wouldn't be a little too much work... How did you get the stuff below?
What would I need to do to encode the file like below?
Thanks,
Jan
"Romain Strieff [dBVIPS]" <Rom...@forget.it> wrote in message
news:MPG.1837215e5...@news.dbase.com...
> >
> Since attachments are just encoded text, did you try to encode it
> yourself and just add it to the message body string?
>
>
>
> ------=_NextPart_000_00C4_01C27951.245928D0
> Content-Type: application/pdf;
> name="ANFAHRT.PDF"
> Content-Disposition: attachment;
> filename="ANFAHRT.PDF"
> Content-Transfer-Encoding: base64
>
> JVBERi0xLjMNJeLjz9MNCjE1IDAgb2JqDTw8IA0vTGluZWFyaXplZCAxIA0vTyAxNyANL0gg
>
> ------=_NextPart_000_00C4_01C27951.245928D0--
>
cu
Ronald
"Richard Ouellette" <rouel...@mandecsys.com> wrote in message
news:aqhg89$ifg$1...@news.dbase.com...
For this kind of work, I use ASPMAIL http://www.aspemail.com/index.html.
Exemple:
local oEmail
try
oEmail=new email()
catch (exception e)
RunHidden( "regsvr32 /s d:\AspEmail.dll" )
RunHidden( "regsvr32 /s d:\AspUpLoad.dll" )
sleep 5
try
oEmail=new email()
catch (exception e)
msgbox(e.message, "Error Code "+ltrim(str(e.code)))
cretour = false
endtry
endtry
oEmail.IsHTML = true \\ if your message is in HTML
oEmail.body = ReadFile(form.EFFILEHTML.Value,65535)
oEmail.host = form.Host.Value
oEmail.from = form.FROM.Value
oEmail.FromName = oEmail.EncodeHeader(form.FromName.Value)
oEmail.subject = oEmail.EncodeHeader(form.EFSUBJECT.Value)
oEmail.AddAddress(form.EFTO.Value)
if not empty(form.EFATTACHE.value)
// loop if ou have more than 1 attachement
for i = 1 to NumberWords(form.EFATTACHE.value,",")
temp = GetWord(form.EFATTACHE.value,",",i)
if not empty(temp)
oEmail.AddAttachment(temp)
endif
next
endif
if empty(form.EFCC.value) = false
oEmail.AddCC(form.EFCC.value)
endif
try
oEmail.send()
catch (exception e)
msgbox(e.message, "Error Code "+ltrim(str(e.code)))
endtry
oEmail.reset()
release object oEmail
class email of oleautoclient("persits.mailsender") custom // do not change
this.host:="smtp.xxxxx.com" // put your ISP's Mail Server name
this.from := "al...@xxxx.com" // put your e-mail address
this.FromName := "someone" // put your real name
this.subject := "Nothing." // default subject
this.body := "Nothing." // default body text
this.IsHTML = False
endclass
Bye
Sylvain Lavoie
Jan
"Richard Ouellette" <rouel...@mandecsys.com> wrote in message
news:aqo6te$ago$2...@news.dbase.com...
"Richard Ouellette" je napisal v sporočilo...
> I also noticed that Romain has
> provided some input as well... perhaps Marko will also jump in.
Sorry, no time to spare at the moment, so this time I am jumping only _over_
this thread. <g>
Marko Mihorko [dBVIPS]
Presernova druzba d.d.
dBASE, Inc. International Partner
http://www.prdr.com/dbase
Thanks,
Jan
"Romain Strieff [dBVIPS]" <Rom...@forget.it> wrote in message
news:MPG.1837215e5...@news.dbase.com...
Thanks,
Jan
"Romain Strieff [dBVIPS]" <Rom...@forget.it> wrote in message
news:MPG.183d4739e...@news.dbase.com...