Hi
Is possible to attach files using MailTo:
I can´t use SMTP because the Intranet uses a exchange server
Regards
Pedro
LOCAL cTexto:= "txt ....",;
eSubject:="?Subject="+ cTexto,;
eBody:="&body=" + cTexto ,;
eTo:="mailto:bmaimo@piema.info",;
eAttachment:="&attach=\My Documents\file.txt",;
CmdLine := eTo+eSubject+ebody+eAttachment
Shellexecute(ownd:hWnd,"open",cMdLine )
...
sAddedText = sAddedText & "&Attach=" & Chr(34) & txtAttachmentFileLocation & Chr(34)
Call ShellExecute(Me.hWnd, "open", sText, vbNullString, vbNullString, SW_SHOWNORMAL)
// Testing FiveWin new Internet Outgoing mail (SMTP protocol) Class
#include "FiveWin.ch"
static oWnd
//----------------------------------------------------------------------------//
function eudora()
local oBar
DEFINE WINDOW oWnd TITLE "Gerenciador de E-Mail"
DEFINE BUTTONBAR oBar _3D OF oWnd
DEFINE BUTTON OF oBar ;
ACTION Blat( "Este e o corpo da mensagem",;
"smtp.itelefonica.com.br",;
"jscrocha@terra.com.br",;
"irochinha@itelefonica.com.br",;
"Greetings from Joe!",;
"Usuario",;
"Senha",;
"c:\drvgames.txt" ) TOOLTIP "Enviar Mail"
DEFINE BUTTON OF oBar ;
ACTION GetMail( "usuario",;
"Senha",;
"pop.sao.terra.com.br" ) TOOLTIP "Receber Mail"
DEFINE BUTTON OF oBar ;
ACTION SendMail( "smtp.itelefonica.com.br",;
"jscrocha@terra.com.br",;
"irochinha@itelefonica.com.br",;
"SendMail teste" ,;
"Este foi um teste com SendMail" ,;
25 ,;
"c:\drvgames.txt" ,;
"usuario" ,;
"Senha" )
SET MESSAGE OF oWnd TO "SoftClever" NOINSET DATE TIME KEYBOARD
ACTIVATE WINDOW oWnd
return nil
//----------------------------------------------------------------------------//
function blat( cbody ,;
cserver ,;
cto ,;
cf ,;
csubject ,;
cu ,;
cpw ,;
cattach )
BlatCMD := [ -body "] + alltrim(cbody) + ["] + ;
[ -server ] + alltrim(cserver) + ;
[ -to ] + alltrim(cto) + ;
[ -f ] + alltrim(cf) + ;
[ -subject "] + alltrim(csubject) + ["] + ;
[ -u ] + alltrim(cu) + ;
[ -pw ] + alltrim(cpw) + ;
[ -attach ] + alltrim(cattach)
cMacro="BLAT.EXE" + BlatCMD
memowrit( "put.bat", cMacro )
? cMacro
MsgRun( "Enviando a "+LOWER(cServer)+"..." )
WinExec( "put.bat", 7 )
RETURN .T.
function GetMail( cuser ,;
cpass ,;
cserver )
GetMCMD := " -u " + alltrim(cuser) + ;
" -pw " + alltrim(cpass) + ;
" -s " + alltrim(cserver)
cMacro="GETMAIL.EXE" + GetMCMD
memowrit( "get.bat", cMacro )
? cMacro
MsgRun( "Recebendo de "+LOWER(cServer)+"..." )
WinExec( "get.bat", 7 )
RETURN .T.
function SendMail( cSmtpServer ,;
cTo ,;
cFrom ,;
cSubject ,;
cBody ,;
nSmtpPort ,;
cAttachment ,;
cUser ,;
cPassword )
SendMail := " /smtpserver " + alltrim(cSmtpServer) +;
" /to " + alltrim(cTo) +;
" /from " + alltrim(cFrom) +;
" /subject " + alltrim(cSubject) +;
" /body " + alltrim(cBody) +;
" /smtpport " + str(nSmtpPort) +;
" /attachment " + alltrim(cAttachment) +;
" /user " + alltrim(cUser) +;
" /password " + alltrim(cPassword)
cMacro="SENDMAIL " + SendMail
memowrit( cMacro )
? cMacro
memowrit("sendmail.bat",cMacro)
MsgRun( "Conectando a "+LOWER(cSmtpServer)+"..." )
WinExec( cMacro, 7 )
RETURN .T.
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 116 guests