Jump to content
Fivewin Brasil

Rotina de Email Simples(RESOLVIDO)


fabin01

Recommended Posts

Bom dia Galera...

to querendo uma rotina de email simples..

tenho um campo onde o usario digita seu endereço de email e tenho um botao de "enviar email"

ai queria quando ele clicasse no botao, abrisse o outloock ja com o campo de emial preenchido digitaria a mensagem e enviaria... entenderam?? tem como fazer?

valews

Obrigado pela ATENÇÃO e AJUDA!

"O homem deve criar as oportunidades e não somente encontrá-las."

Fábio Igor (BH-MG)

fabio.igor@hotmail.com

Iniciante

FWH 2.8

[x]Harbour 9.61

xdev 0.70

WS

Editado por - fabin01 on 07/10/2009 15:49:30

Link to comment
Share on other sites

Bom dia Galera...

to querendo uma rotina de email simples..

tenho um campo onde o usario digita seu endereço de email e tenho um botao de "enviar email"

ai queria quando ele clicasse no botao, abrisse o outloock ja com o campo de emial preenchido digitaria a mensagem e enviaria... entenderam?? tem como fazer?

valews

Obrigado pela ATENÇÃO e AJUDA!

"O homem deve criar as oportunidades e não somente encontrá-las."

Fábio Igor (BH-MG)

fabio.igor@hotmail.com

Iniciante

FWH 2.8

[x]Harbour 9.61

xdev 0.70

WS

Editado por - fabin01 on 07/10/2009 15:49:30

Link to comment
Share on other sites

Eita cabra dificil, nem para olhar o \samples ???

TESTMAIL.PRG

Ou olhar os LINKS e postagens, ou consultar dicas + dicas ou pesquisa na pagina principal??

Mira

http://www.fivewin.com.br/forum/topic.asp?TOPIC_ID=15295

Abraços.

João Santos - São Paulo.

kmt_karinha@pop.com.br

kapiaba@brfree.com.br

Fone: (11) 3106-2832

FWH 2.7 - xHARBOUR 0.99.61 - WorkShop.Exe

Link to comment
Share on other sites

kapiaba usei esta rotina aqui que voce tinha postado em um topico


Local oOutlook, oMail

EC=email

oOutlook = CREATEOBJECT( "Outlook Application" )

oMail = oOutlook:CreateItem( olMailItem )

oMail:Recipients:Add( "EC" )

oMail:Subject = "teste"

oMail:Attachments:Add( "c:\xharbour\image.jpg" )

oMail:HTMLBody = MEMOREAD( "c:\xharbour\test.htm" )

oMail:Send()

oOutlook:Quit()

Return Nil

id=code>id=code>

porem ocorreu erro? a minha sintaxe esta certa? coloquei este EC como variavel que recebe o email do cadastro que esta na tela

Erro:


===========

Path and name: C:\novo\Nova pasta\Agenda.EXE (32 bits)

Size: 1,585,152 bytes

Time from start: 0 hours 0 mins 19 secs

Error occurred at: 10/06/2009, 13:56:37

Error description: Error TOleAuto/-1 CO_E_CLASSSTRING: TOLEAUTO:NEW

Args:

[ 1] = C Outlook Application

Stack Calls

===========

Called from: => THROW(0)

Called from: win32ole.prg => TOLEAUTO:NEW(319)

Called from: win32ole.prg => CREATEOBJECT(67)

Called from: TesteSistema.000 => ROTINA_EMAIL(765)

Called from: TesteSistema.000 => (b)CONTATOS_FOLHA_ALTERA(445)

Called from: BTNBMP.prg => TBTNBMP:CLICK(319)

Called from: BTNBMP.prg => TBTNBMP:LBUTTONUP(487)

Called from: WINDOW.prg => TWINDOW:HANDLEEVENT(0)

Called from: CONTROL.prg => TBTNBMP:HANDLEEVENT(1354)

Called from: WINDOW.prg => _FWH(3165)

Called from: => DIALOGBOX(0)

Called from: DIALOG.prg => TDIALOG:ACTIVATE(270)

Called from: TesteSistema.000 => CONTATOS_FOLHA_ALTERA(447)

Called from: TesteSistema.000 => (b)TELA_CONTATOS_FOLHA(287)

Called from: CONTROL.prg => TCONTROL:LDBLCLICK(1753)

Called from: WBROWSE.prg => TWBROWSE:LDBLCLICK(1039)

Called from: WINDOW.prg => TWINDOW:HANDLEEVENT(0)

Called from: CONTROL.prg => TWBROWSE:HANDLEEVENT(1354)

Called from: WINDOW.prg => _FWH(3165)

Called from: => DIALOGBOX(0)

Called from: DIALOG.prg => TDIALOG:ACTIVATE(270)

Called from: TesteSistema.000 => TELA_CONTATOS_FOLHA(289)

Called from: TesteSistema.000 => (b)MENUPRINCIPAL(78)

Called from: MENU.prg => TMENU:COMMAND(407)

Called from: WINDOW.prg => TWINDOW:COMMAND(934)

Called from: WINDOW.prg => TWINDOW:HANDLEEVENT(0)

Called from: WINDOW.prg => _FWH(3165)

Called from: => WINRUN(0)

Called from: WINDOW.prg => TWINDOW:ACTIVATE(883)

Called from: TesteSistema.000 => MAIN(63)

id=code>id=code>

valews

Obrigado pela ATENÇÃO e AJUDA!

"O homem deve criar as oportunidades e não somente encontrá-las."

Fábio Igor (BH-MG)

fabio.igor@hotmail.com

Iniciante

FWH 2.8

[x]Harbour 9.61

xdev 0.70

WS

Link to comment
Share on other sites

Eita cabra da peste!! kkkkkkk

http://www.fivewin.com.br/forum/topic.asp?TOPIC_ID=13002

Você pelo menos, TESTO TESMAIL.PRG ???? Facin, facin! Até eu, consigo entender.

Abraços.

João Santos - São Paulo.

kmt_karinha@pop.com.br

kapiaba@brfree.com.br

Fone: (11) 3106-2832

FWH 2.7 - xHARBOUR 0.99.61 - WorkShop.Exe

Editado por - kapiaba on 06/10/2009 14:35:02

Link to comment
Share on other sites

certo cabra da peste tu me convenceste usei ele e deu certim..

porem cabra queria que o email enviado para o email que etsa na editbox entendeu?

como implemento para que o para do thunder fique com o email da minha editbox??

e tambem sempre quando entro ta logado com a conta de outra pessoa tem algum problema isso?

e smepre pede uma senha mas apertando o cancelar repetidamente ai para de édir... o que seria essa senha?

valews

Obrigado pela ATENÇÃO e AJUDA!

"O homem deve criar as oportunidades e não somente encontrá-las."

Fábio Igor (BH-MG)

fabio.igor@hotmail.com

Iniciante

FWH 2.8

[x]Harbour 9.61

xdev 0.70

WS

Editado por - fabin01 on 06/10/2009 14:51:36

Link to comment
Share on other sites

//-> Veja se voce consegue entender:


//-> Incluido em: 16/09/2009 - Joao

//-> Rotina By Rossine e Yuri, Forum FiveWin Brasil. Funcionou perfeito.

FUNCTION ENVIAR_EMAIL()

LOCAL cSubject, cNoteText, cMsgType, cConversationID, dDate, cTime, ;

lReceipt, lFromUser, aOrigin, aRecipients, aFiles, oMail, ;

EmailCliente, cChave, cXml

PUBLIC wNomeEmpresa

TONE(900,2)

CURSORWAIT()

//-> Abre Notas Fiscais

SELECT CADNFE

SET ORDER TO 01

SEEK FATURCOD2 //-> Numero da Nota Fiscal

IF FOUND()

SELECT CADFATUR

SET ORDER TO 01 //-> Por FATURCOD - Indice

SEEK CADNFE->FATURCOD

ELSE

TONE(900,2)

MsgStop( OemToAnsi( "Aten‡Æo usu rio: " ) +CRLF+ ;

OemToAnsi( "Nota fiscal nÆo localizada " ) +CRLF+ ;

OemToAnsi( "para gerar o Email do Cliente. " ), ;

OemToAnsi( "Impossivel enviar o email... " ) )

XFOCUS( oNota )

RETURN NIL

ENDIF

//-> Se achou o cliente em CADFATUR.DBF - la em cima

IF FOUND()

cValNF := CADFATUR->TOTNF //-> Certo isto Paulo?

SELECT CADCLIEN

SET ORDER TO 01

SEEK CADFATUR->CLIENCOD

ELSE

TONE(900,2)

MsgStop( OemToAnsi( "Aten‡Æo usu rio: " ) +CRLF+ ;

OemToAnsi( "Nota fiscal nÆo localizada " ) +CRLF+ ;

OemToAnsi( "para gerar o Email do Cliente. " ), ;

OemToAnsi( "Impossivel enviar o email... " ) )

XFOCUS( oNota )

RETURN NIL

ENDIF

//-> Se achou o cliente em CADCLIEN.DBF

IF FOUND()

aEmpresa := CADCLIEN->CLIENTE

aTabela := LOWER( CADCLIEN->EMAILNFE ) //-> Email do Cliente

IF CADCLIEN->EMAILNFE = [ ] //-> se estiver vazio

TONE(900,2)

//-> Crie uma funcao para alterar o email, caso o programa nao ache

ALTERAR_EMAIL_CLIENTE( DeOndeVem := "ENVIAR_EMAIL" )

RETURN NIL

ENDIF

ELSE

TONE(900,2)

MsgStop( OemToAnsi( "Aten‡Æo usu rio: " ) +CRLF+ ;

OemToAnsi( "Empresa nÆo localizada em CADCLIEN.DBF" ) +CRLF+ ;

OemToAnsi( "para gerar o Email do Cliente/Empresa." ), ;

OemToAnsi( "Impossivel enviar o email... ERRo! " ) )

XFOCUS( oNota )

RETURN NIL

ENDIF

//----------------------------------------------------------------------//

TONE(900,2)

//-> Assunto do Email enviado

cSubject := "Nota Fiscal Eletrônica - Arquivo XML"

//-> Corpo do Email

cNoteText := "Prezado Cliente:" +CRLF+CRLF+;

ALLTRIM( CADCLIEN->CLIENTE ) +CRLF+CRLF+;

"Para suas devidas providencias, " + ;

"segue em anexo o arquivo digital, " + ;

"padrão XML, que deu origem " + ;

"a nossa Nota Fiscal Eletrônica com as " + ;

"seguintes características: " +CRLF+CRLF+;

"Número: "+STRZERO( FATURCOD2 ) +CRLF+ ;

"Emissão: " + DTOC( CADFATUR->DTEMIS ) +CRLF+ ;

"Valor: " + ;

TRANSF(( cValNF ),"@E 999,999,999.99")+CRLF+CRLF+;

"Atenciosamente," +CRLF+CRLF+;

ALLTRIM(wNomeEmpresa) //-> Nome do Remetente/Enviador

cMsgType := "C"

cConversationID := ""

dDate := DATE()

cTime := TIME()

lReceipt := .F.

lFromUser := .T.

aOrigin := {""} //-> Email de quem enviou, nao precisa informar

//-> Email do Cliente que vai receber

//-> aRecipients := {"joao@pleno.com.br"} //-> Exemplo Original

//-> Pegando o Email do Cliente do Banco de dados CADCLIEN.DBF

EmailCliente := LOWER(ALLTRIM( CADCLIEN->EMAILNFE ) )

//-> Transformo para ficar igual ao exemplo

aRecipients := { EmailCliente } //-> email final para enviar

//-> Anexos do email - Original

//-> aFiles := {"c:\TORBAL2\SS.TXT"}

//-> A chave de acesso da NF-e

cChave := ALLTRIM(CADNFE->CHAVEACES)

cXml := cPathNFe := CURDRIVE() + ":\" + GETCURDIR() + ;

"\REMESSA\ENVIADAS\" + ;

ALLTRIM( cChave ) + ;

"nfe.xml"

aFiles := { cXml } //-> Aquivo para anexxar

//----------------------------------------------------------------------//

//-> Envia o Email - Disparo para o OutLoox Express

oMail:=TMail():New( cSubject , ;

cNoteText , ;

cMsgType , ;

cConversationID, ;

dDate , ;

cTime , ;

lReceipt , ;

lFromUser , ;

aOrigin , ;

aRecipients , ;

aFiles )

//-> Ativa o OutLook Express - OutLook Express, Tem que ser PADRÇO

oMail:Activate()

IF ( oMail:nRetCode ) == 2 .OR. ( oMail:nRetCode ) == 26

TONE( 900, 2 )

MsgStop( OemToAnsi( "Aten‡Æo usu rio: Favor Anotar. " )+CRLF+;

OemToAnsi( "Ocorreu algum problema com seu Outlook " )+CRLF+;

OemToAnsi( "Express. Tente solucionar o Problema: " )+CRLF+;

OemToAnsi( " " )+CRLF+;

OemToAnsi( " no BotÆo: do Windows: " )+CRLF+;

OemToAnsi( "Configura‡äes. " )+CRLF+;

OemToAnsi( "Painel de Controle " )+CRLF+;

OemToAnsi( "Op‡äes da Internet " )+CRLF+;

OemToAnsi( " na Aba Programas " )+CRLF+;

OemToAnsi( " " )+CRLF+;

OemToAnsi( "Verifique: Se nÆo estiver, troque. " )+CRLF+;

OemToAnsi( " " )+CRLF+;

OemToAnsi( "Embaixo de Onde Estiver Escrito: " )+CRLF+;

OemToAnsi( " " )+CRLF+;

OemToAnsi( "Vocˆ Pode Especificar Que Programa o " )+CRLF+;

OemToAnsi( "Windows Utiliza Automaticamente Para " )+CRLF+;

OemToAnsi( "Cada Servi‡o de Internet. PadrÆo Abaixo: " )+CRLF+;

OemToAnsi( " " )+CRLF+;

OemToAnsi( "Email: OutLook Express - PadrÆo ‚ este. " )+CRLF+;

OemToAnsi( "Grupo de Noticias: OutLook Express " )+CRLF+;

OemToAnsi( " " )+CRLF+;

OemToAnsi( "NÆo Use o Microsoft Office OutLook. " )+CRLF+;

OemToAnsi( " " )+CRLF+;

OemToAnsi( "Permitido: Microsoft OutLook Express " )+CRLF+;

OemToAnsi( " " )+CRLF+;

OemToAnsi( "Se nÆo solucionar, entre em contato. " ), ;

OemToAnsi( "OutLook Express - Instala‡Æo Obrigat¢ria. " ) )

ENDIF

//-> Fecha o Outlook Express

oMail:End()

TONE(900,2)

SELECT CADNFE

RETURN( .T. )

id=code>id=code>

João Santos - São Paulo.

kmt_karinha@pop.com.br

kapiaba@brfree.com.br

Fone: (11) 3106-2832

FWH 2.7 - xHARBOUR 0.99.61 - WorkShop.Exe

Link to comment
Share on other sites

as vezes é dificil de entender vc kapi...

voce pede pra eu usar o do samples...

ai quando eu uso vc me passa o do outlook..

este ta enorme vou tentar entender aqui

Obrigado pela ATENÇÃO e AJUDA!

"O homem deve criar as oportunidades e não somente encontrá-las."

Fábio Igor (BH-MG)

fabio.igor@hotmail.com

Iniciante

FWH 2.8

[x]Harbour 9.61

xdev 0.70

WS

Link to comment
Share on other sites

citação:

as vezes é dificil de entender vc kapi...

voce pede pra eu usar o do samples...

ai quando eu uso vc me passa o do outlook..

este ta enorme vou tentar entender aqui

Obrigado pela ATENÇÃO e AJUDA!

"O homem deve criar as oportunidades e não somente encontrá-las."

Fábio Igor (BH-MG)

fabio.igor@hotmail.com

Iniciante

FWH 2.8

[x]Harbour 9.61

xdev 0.70

WS


id=quote>id=quote>

RAPAZINHO...

PENSE ASSIM:

QUANTO MAIS SE SABE, QUE ÓTIMO!! SOIS ILIMITADO!!

EU PROCURO SABER TUDO, POIS O POUCO QUE SAY, NÃO ME SATISFAZ!! Tà LIGADO?? kkkkkkkkkk

E, EM TESTMAIL.PRG, ENSINA DOS DOIS MODOS, O QUE SIGINIFICA, QUE NEM TESTATES IN LOCO. kkkkkkkkk

Abraços.

João Santos - São Paulo.

kmt_karinha@pop.com.br

kapiaba@brfree.com.br

Fone: (11) 3106-2832

FWH 2.7 - xHARBOUR 0.99.61 - WorkShop.Exe

Editado por - kapiaba on 06/10/2009 15:13:24

Link to comment
Share on other sites

citação:

citação:

as vezes é dificil de entender vc kapi...

voce pede pra eu usar o do samples...

ai quando eu uso vc me passa o do outlook..

este ta enorme vou tentar entender aqui

Obrigado pela ATENÇÃO e AJUDA!

"O homem deve criar as oportunidades e não somente encontrá-las."

Fábio Igor (BH-MG)

fabio.igor@hotmail.com

Iniciante

FWH 2.8

[x]Harbour 9.61

xdev 0.70

WS


id=quote>id=quote>

RAPAZINHO...

PENSE ASSIM:

QUANTO MAIS SE SABE, QUE ÓTIMO!! SOIS ILIMITADO!!

EU PROCURO SABER TUDO, POIS O POUCO QUE SAY, NÃO ME SATISFAZ!! Tà LIGADO?? kkkkkkkkkk

E, EM TESTMAIL.PRG, ENSINA DOS DOIS MODOS, O QUE SIGINIFICA, QUE NEM TESTATES IN LOCO. kkkkkkkkk

Abraços.

João Santos - São Paulo.

kmt_karinha@pop.com.br

kapiaba@brfree.com.br

Fone: (11) 3106-2832

FWH 2.7 - xHARBOUR 0.99.61 - WorkShop.Exe

Editado por - kapiaba on 06/10/2009 15:13:24


id=quote>id=quote>

e vc ta certo conhecimento nunca é d+

mas em relaçao ao samples a direct message pelo que eu entendi ela seria que ia direcionar para o email que eu queria nao para o usario que esta logado no thunder certo??

porem quando testei ele, ele ficou na caixa de entrada o interactive message ja foi para a tela para enviar email se que o para ficou em branco e eu queria que ficasse preenchido com o email que ta na edit e no banco tendeu?

valews

Obrigado pela ATENÇÃO e AJUDA!

"O homem deve criar as oportunidades e não somente encontrá-las."

Fábio Igor (BH-MG)

fabio.igor@hotmail.com

Iniciante

FWH 2.8

[x]Harbour 9.61

xdev 0.70

WS

Editado por - fabin01 on 06/10/2009 16:23:49

Link to comment
Share on other sites

citação:...ficasse preenchido com o emial que ta na edit...
id=quote>id=quote>

EMial ? Endereço eletrônico dos gatos? icon_smile_big.gif

Brincadeira... Como o Kapi começou a responder, vou deixar ele terminar, já que nem li a rotina dele =D

Luis Fernando Jr.(Luisão)

"Seize the day or die regretting the time you lost"

FWH8.1 + SQLLIB 1.9d + xHB 1.10 + xDev 0.65 + @SAY

Link to comment
Share on other sites

citação:

citação:...ficasse preenchido com o emial que ta na edit...
id=quote>id=quote>

EMial ? Endereço eletrônico dos gatos? icon_smile_big.gif

Brincadeira... Como o Kapi começou a responder, vou deixar ele terminar, já que nem li a rotina dele =D

Luis Fernando Jr.(Luisão)

"Seize the day or die regretting the time you lost"

FWH8.1 + SQLLIB 1.9d + xHB 1.10 + xDev 0.65 + @SAY


id=quote>id=quote>

foi um pequeno erro de digitaçao queria dizer email...

luizao e que estou usando a rotina de email do samples ai quero que o email que esta na minha edit preencha o campo PARA do thunder entendeu??

como faria isso pq com expliquei acima o direct ta indo é pra caixa de entrada e o interective para a tela de envio so que o campo para fica em branco

valews

Obrigado pela ATENÇÃO e AJUDA!

"O homem deve criar as oportunidades e não somente encontrá-las."

Fábio Igor (BH-MG)

fabio.igor@hotmail.com

Iniciante

FWH 2.8

[x]Harbour 9.61

xdev 0.70

WS

Link to comment
Share on other sites

Eu uso a TMail. Do jeito que o kapi postou, tá mais do que completo. Você visualizou o código que ele mandou ?

Lembre-se que é ARecipients, logo você tem que passar uma tabela assim {email1@dominio.com,...,emailn@dominio.com}

Luis Fernando Jr.(Luisão)

"Seize the day or die regretting the time you lost"

FWH8.1 + SQLLIB 1.9d + xHB 1.10 + xDev 0.65 + @SAY

Link to comment
Share on other sites

Abra o banco onde esta o email e ponha o PONTEIRO em cima do cliente que tem email:


//-> Pegando o Email do Cliente do Banco de dados CADCLIEN.DBF

EmailCliente := LOWER(ALLTRIM( CADCLIEN->EMAILNFE ) )

//-> Transformo para ficar igual ao exemplo

aRecipients := { EmailCliente } //-> email final para enviar

id=code>id=code>

João Santos - São Paulo.

kmt_karinha@pop.com.br

kapiaba@brfree.com.br

Fone: (11) 3106-2832

FWH 2.7 - xHARBOUR 0.99.61 - WorkShop.Exe

Link to comment
Share on other sites

Para quem interessa, abaixo vai uma rotina muito boa para enviar e-mail, e não usa o outlook, é só configurar com os dados e pronto.

Uma pergunta, principalmente pro Kapi,

Estou a procura de uma rotina que rotaciona, gira um texto na dialog ou window, da esquerda para a direita ou vice-versa, onde pode conseguir?

************** rotina de enviar e-mail ******************

#include "fivewin.ch"

Function main()

**local cServerIp := "smtp.uol.com.br" //servidor smtp porta 25

**local cServerIp := "smtp.jnd.terra.com.br" //servidor smtp porta 587

local cServerIp := "smtp.ig.com.br" //servidor smtp porta 465

**senha_terra:="senha"

*local cpop := "pop.jnd.terra.com.br" //porta 110

*local ePASSw := "senha"

*Local cFrom := "mkyx@terra.com.br" //de

*Local cUser := "senha"

*local cpop := "pop3.uol.com.br" //porta 110

*local ePASSw := "senha"

*Local cFrom := "funky-sclara@uol.com.br" //de

*Local cUser := "funky-scalra"

local cpop := "pop.ig.com.br" //porta 110 ig:=995 os demais ‚ 110

local ePASSw := "senha"

Local cFrom := "mkyx@ig.com.br" //de

Local cUser := "mkyx"

local aTo := "mkyx@ig.com.br"

local cSubject := "Assunto do Email-prompt " //assunto

Local afiles := {"corget.c"} //anexo

local cMsg := " isto ‚ um teste!!!!!!!!!!!" //mensagem de texto

/*

define dialog e_mail from 10,10 to 30,100 title "Rotina para Enviar/Ler E-Mail"

@ 5,5 to 200,200 label ""

@ 10,10 say "De"

@ 25,10 say "Para"

@ 40,10 say "

*/

*IF Inetestaconectada()=.T. // verefica se ha comunicação com a internet

? "VAI"

hb_sendmail(cServerIP,465,cFrom,aTo,"","",cMsg, cSubject,afiles, cUser, ePASSW, 3 , .F., .F.)

** SendMail(cServerIP,465,cFrom,aTo,"","",cMsg, cSubject,afiles, cUser, ePASSw, cPop , 3 , .t. , .f. ,.t. , .t.,10000,"")

** terra - porta 587

? "FOI"

*endif

Return .t.

FUNCTION SendMail( cServer, nPort, cFrom, aTo, aCC, aBCC, cBody, cSubject, aFiles, cUser, cPass, cPopServer, nPriority, lRead, lTrace, lPopAuth, lNoAuth, nTimeOut, cReplyTo )

/*

cServer -> Necessário. Nome IP ou o domínio do servidor de email

nPort -> Opcional. A porta usada pelo o meu servidor de email

cFro -> Necessário. Endereço de email do remetente

aTo -> Necessário. Seqüência de caracteres ou matriz de endereços de email para enviar o email para

aCC -> Opcional. Seqüência de caracteres ou matriz de email adresses para CC (Copia do email)

aBCC -> Opcional. Seqüência de caracteres ou matriz de email adresses de Cco (copia oculta do email)

cBody -> Opcional. A mensagem do corpo do email como texto, ou o nome do arquivo da mensagem em HTML para enviar.

cSubject -> Opcional. Assunto do email

aFiles -> Opcional. Matriz/arquivos de anexos para enviar com o email

cUser -> Necessário. Nome de usuário para o servidor POP3

cPass -> Necessário. Senha para cUser

cPopServer -> Necessário. Nome IP ou o domínio do servidor de email POP3

nPriority -> Opcional. Email de prioridade: 1 = alta, 3 = Normal (padrão), 5 = baixa

lRead -> Opcional. Se definido como. T., uma solicitação de confirmação é enviada. A configuração padrão é. f.

lTrace -> Opcional. Se definido como. T., um arquivo de log é criado (sendmail .log). A configuração padrão é. f.

lPopAuth -> Opcional. Sinalizador para indicar que Autentication POP3 é usado. A configuração padrão é. T.

lnoauth -> Opcional. Servidores de email que nao precisam de autenticacao smtp

nTimeOut -> Opcional. Numero de milesimos de segundos a Aguarda o envio - Padrão é 2000(2 segundos)

cReplyTo -> Opcional.

*/

LOCAL oInMail, cBodyTemp, oUrl, oMail, oAttach, aThisFile, cFile, cFname, cFext, cData, oUrl1

LOCAL cTmp :=""

LOCAL cMimeText := ""

LOCAL cTo := ""

LOCAL cCC := ""

LOCAL cBCC := ""

LOCAL lConnectPlain := .F.

LOCAL lReturn := .T.

LOCAL lAuthLogin := .F.

LOCAL lAuthPlain := .F.

LOCAL lConnect := .T.

LOCAL oPop

LOCAL adata:={},nCount,nSize,nSent

/*

DEFAULT cUser TO ""

DEFAULT cPass TO ""

DEFAULT nPort TO 25

DEFAULT aFiles TO {}

DEFAULT nPriority TO 3

DEFAULT lRead TO .F.

DEFAULT lTrace TO .F.

DEFAULT lPopAuth TO .T.

DEFAULT lNoAuth TO .F.

DEFAULT nTimeOut TO 10000 // 20000

DEFAULT cReplyTo TO ""

*/

cUser := StrTran( cUser, "@", "&at;" )

IF !( (".htm" IN Lower( cBody ) .OR. ".html" IN Lower( cBody ) ) .AND. File(cBody) )

IF !( Right( cBody, 2 ) == HB_OSNewLine() )

cBody += HB_OsNewLine()

ENDIF

ENDIF

// cTo

IF Valtype( aTo ) == "A"

IF Len( aTo ) > 1

FOR EACH cTo IN aTo

IF HB_EnumIndex() != 1

cTmp += cTo + ","

ENDIF

NEXT

cTmp := Substr( cTmp, 1, Len( cTmp ) - 1 )

ENDIF

cTo := aTo[ 1 ]

IF Len( cTmp ) > 0

cTo += "," + cTmp

ENDIF

ELSE

cTo := Alltrim( aTo )

ENDIF

// CC (Carbon Copy)

IF Valtype(aCC) =="A"

IF Len(aCC) >0

FOR EACH cTmp IN aCC

cCC += cTmp + ","

NEXT

cCC := Substr( cCC, 1, Len( cCC ) - 1 )

ENDIF

ELSEIF Valtype(aCC) =="C"

cCC := Alltrim( aCC )

ENDIF

// BCC (Blind Carbon Copy)

IF Valtype(aBCC) =="A"

IF Len(aBCC)>0

FOR EACH cTmp IN aBCC

cBCC += cTmp + ","

NEXT

cBCC := Substr( cBCC, 1, Len( cBCC ) - 1 )

ENDIF

ELSEIF Valtype(aBCC) =="C"

cBCC := Alltrim( aBCC )

ENDIF

IF cPopServer != NIL .AND. lPopAuth

TRY

oUrl1 := tUrl():New( "pop://" + cUser + ":" + cPass + "@" + cPopServer + "/" )

oUrl1:cUserid := Strtran( cUser, "&at;", "@" )

opop:= tIPClientPOP():New( oUrl1,,ltrace)

IF oPop:Open()

oPop:Close()

ENDIF

CATCH

? "VOLTOU1"

lReturn := .F.

END

ENDIF

IF !lReturn

? "VOLTOU2"

RETURN .F.

ENDIF

TRY

oUrl := tUrl():New( "smtp://" + cUser + "@" + cServer + '/' + cTo )

CATCH

? "VOLTOU3"

lReturn := .F.

END

IF !lReturn

? "VOLTOU4"

RETURN .F.

ENDIF

oUrl:nPort := nPort

oUrl:cUserid := Strtran( cUser, "&at;", "@" )

oMail := tipMail():new()

oAttach := tipMail():new()

oAttach:SetEncoder( "7-bit" )

IF (".htm" IN Lower( cBody ) .OR. ".html" IN Lower( cBody ) ) .AND. File(cBody)

cMimeText := "text/html ; charset=ISO-8859-1"

oAttach:hHeaders[ "Content-Type" ] := cMimeText

cBodyTemp := cBody

cBody := MemoRead( cBodyTemp ) + chr( 13 ) + chr( 10 )

ELSE

oMail:hHeaders[ "Content-Type" ] := "text/plain; charset=iso8851"

ENDIF

oAttach:SetBody( cBody )

oMail:Attach( oAttach )

oUrl:cFile := cTo + If( Empty(cCC), "", "," + cCC ) + If( Empty(cBCC), "", "," + cBCC)

oMail:hHeaders[ "Date" ] := tip_Timestamp()

oMail:hHeaders[ "From" ] := cFrom

IF !Empty(cCC)

oMail:hHeaders[ "Cc" ] := cCC

ENDIF

IF !Empty(cBCC)

oMail:hHeaders[ "Bcc" ] := cBCC

ENDIF

IF !Empty(cReplyTo)

oMail:hHeaders[ "Reply-To" ] := cReplyTo

ENDIF

TRY

oInmail := tIPClientSMTP():New( oUrl,,ltrace)

** oInmail := tIPClientSMTP():New( oUrl)

** oInmail := tIPClient():New( oUrl,lTrace)

** oInmail := tIPClient():New( oUrl,,.t.)

CATCH

? "VOLTOU5"

lReturn := .F.

END

IF !lReturn

? "VOLTOU6"

RETURN .F.

ENDIF

oInmail:nConnTimeout:= nTimeOut

IF !lNoAuth

IF oInMail:Opensecure()

WHILE .T.

oInMail:GetOk()

IF oInMail:cReply == NIL

EXIT

ELSEIF "LOGIN" IN oInMail:cReply

lAuthLogin := .T.

ELSEIF "PLAIN" IN oInMail:cReply

lAuthPlain := .T.

ENDIF

ENDDO

IF lAuthLogin

IF !oInMail:Auth( cUser, cPass )

lConnect := .F.

ELSE

lConnectPlain := .T.

ENDIF

ENDIF

IF lAuthPlain .AND. !lConnect

IF !oInMail:AuthPlain( cUser, cPass )

lConnect := .F.

ENDIF

ELSE

IF !lConnectPlain

oInmail:Getok()

lConnect := .F.

ENDIF

ENDIF

ELSE

lConnect := .F.

ENDIF

ELSE

lConnect := .F.

ENDIF

IF !lConnect

if !lNoAuth

oInMail:Close()

endif

TRY

oInmail := tIPClientSMTP():New( oUrl,,ltrace)

** oInmail := tIPClientSMTP():New( oUrl,,.t.)

** oInmail := tIPClient():New( oUrl,lTrace)

** oInmail := tIPClient():New( oUrl,,.t.)

CATCH

? "VOLTOU7"

lReturn := .F.

END

oInmail:nConnTimeout:=nTimeOut

IF !oInMail:Open()

lConnect := .F.

oInmail:Close()

RETURN .F.

ENDIF

WHILE .T.

oInMail:GetOk()

IF oInMail:cReply == NIL

EXIT

ENDIF

ENDDO

ENDIF

oInMail:oUrl:cUserid := cFrom

oMail:hHeaders[ "To" ] := cTo

oMail:hHeaders[ "Subject" ] := cSubject

FOR EACH aThisFile IN AFiles

IF Valtype( aThisFile ) == "C"

cFile := aThisFile

cData := Memoread( cFile ) + chr( 13 ) + chr( 10 )

ELSEIF Valtype( aThisFile ) == "A" .AND. Len( aThisFile ) >= 2

cFile := aThisFile[ 1 ]

cData := aThisFile[ 2 ] + chr( 13 ) + chr( 10 )

ELSE

lReturn := .F.

EXIT

ENDIF

oAttach := TipMail():New()

HB_FNameSplit( cFile,, @cFname, @cFext )

IF Lower( cFile ) LIKE ".+\.(vbd|asn|asz|asd|pqi|tsp|exe|sml|ofml)" .OR. ;

Lower( cFile ) LIKE ".+\.(pfr|frl|spl|gz||stk|ips|ptlk|hqx|mbd)" .OR. ;

Lower( cFile ) LIKE ".+\.(mfp|pot|pps|ppt|ppz|doc|n2p|bin|class)" .OR. ;

Lower( cFile ) LIKE ".+\.(lha|lzh|lzx|dbf|cdx|dbt|fpt|ntx|oda)" .OR. ;

Lower( cFile ) LIKE ".+\.(axs|zpa|pdf|ai|eps|ps|shw|qrt|rtc|rtf)" .OR. ;

Lower( cFile ) LIKE ".+\.(smp|dst|talk|tbk|vmd|vmf|wri|wid|rrf)" .OR. ;

Lower( cFile ) LIKE ".+\.(wis|ins|tmv|arj|asp|aabaam|aas|bcpio)" .OR. ;

Lower( cFile ) LIKE ".+\.(vcd|chat|cnc|coda|page|z|con|cpio|pqf)" .OR. ;

Lower( cFile ) LIKE ".+\.(csh|cu|csm|dcr|dir|dxr|swa|dvi|evy|ebk)" .OR. ;

Lower( cFile ) LIKE ".+\.(gtar|hdf|map|phtml|php3|ica|ipx|ips|js)" .OR. ;

Lower( cFile ) LIKE ".+\.(latex|bin|mif|mpl|mpire|adr|wlt|nc|cdf)" .OR. ;

Lower( cFile ) LIKE ".+\.(npx|nsc|pgp|css|sh||shar|swf|spr|sprite)" .OR. ;

Lower( cFile ) LIKE ".+\.(sit|sca|sv4cpio|sv4crc|tar|tcl|tex)" .OR. ;

Lower( cFile ) LIKE ".+\.(texinfo|texi|tlk|t|tr|roff|man|mems)" .OR. ;

Lower( cFile ) LIKE ".+\.(alt|che|ustar|src|xls|xlt|zip|au|snd)" .OR. ;

Lower( cFile ) LIKE ".+\.(es|gsm|gsd|rmf|tsi|vox|wtx|aif|aiff)" .OR. ;

Lower( cFile ) LIKE ".+\.(aifc|cht|dus|mid|midi|mp3|mp2|m3u|ram)" .OR. ;

Lower( cFile ) LIKE ".+\.(ra|rpm|stream|rmf|vqf|vql|vqe|wav|wtx)" .OR. ;

Lower( cFile ) LIKE ".+\.(mol|pdb|dwf|ivr|cod|cpi|fif|gif|ief)" .OR. ;

Lower( cFile ) LIKE ".+\.(jpeg|jpg|jpe|rip|svh|tiff|tif|mcf|svf)" .OR. ;

Lower( cFile ) LIKE ".+\.(dwg|dxf|wi|ras|etf|fpx|fh5|fh4|fhc|dsf)" .OR. ;

Lower( cFile ) LIKE ".+\.(pnm|pbm|pgm|ppm|rgb|xbm|xpm|xwd|dig)" .OR. ;

Lower( cFile ) LIKE ".+\.(push|wan|waf||afl|mpeg|mpg|mpe|qt|mov)" .OR. ;

Lower( cFile ) LIKE ".+\.(viv|vivo|asf|asx|avi|movie|vgm|vgx)" .OR. ;

Lower( cFile ) LIKE ".+\.(xdr|vgp|vts|vtts|3dmf|3dm|qd3d|qd3)" .OR. ;

Lower( cFile ) LIKE ".+\.(svr|wrl|wrz|vrt)" .OR. Empty(cFExt)

oAttach:SetEncoder( "base64" )

ELSE

oAttach:SetEncoder( "7-bit" )

ENDIF

cMimeText := HB_SetMimeType( cFile, cFname, cFext )

// Some EMAIL readers use Content-Type to check for filename

IF ".html" in lower( cFext) .OR. ".htm" in lower( cFext )

cMimeText += "; charset=ISO-8859-1"

ENDIF

oAttach:hHeaders[ "Content-Type" ] := cMimeText

// But usually, original filename is set here

oAttach:hHeaders[ "Content-Disposition" ] := "attachment; filename=" + cFname + cFext

oAttach:SetBody( cData )

oMail:Attach( oAttach )

NEXT

IF lRead

oMail:hHeaders[ "Disposition-Notification-To" ] := cUser

ENDIF

IF nPriority != 3

oMail:hHeaders[ "X-Priority" ] := Str( nPriority, 1 )

ENDIF

oInmail:Write( oMail:ToString() )

/* cData := oMail:ToString()

nSize := Len(cData)

for nCount := 1 to len(cData) step 1024

aadd(aData, substr( cData,nCount,1024))

next

nSent :=0

for nCount :=1 to len(aData)

nSent += oInmail:Write( aData[nCount],len(aData[nCount]))

next

*/

oInMail:Commit()

oInMail:Close()

RETURN lReturn

//-------------------------------------------------------------//

FUNCTION HB_SetMimeType( cFile, cFname, cFext )

cFile := Lower( cFile )

IF cFile LIKE ".+\.vbd" ; RETURN "application/activexdocument="+cFname + cFext

ELSEIF cFile LIKE ".+\.(asn|asz|asd)" ; RETURN "application/astound="+cFname + cFext

ELSEIF cFile LIKE ".+\.pqi" ; RETURN "application/cprplayer=" + cFname + cFext

ELSEIF cFile LIKE ".+\.tsp" ; RETURN "application/dsptype="+cFname + cFext

ELSEIF cFile LIKE ".+\.exe" ; RETURN "application/exe="+cFname + cFext

ELSEIF cFile LIKE ".+\.(sml|ofml)" ; RETURN "application/fml="+cFname + cFext

ELSEIF cFile LIKE ".+\.pfr" ; RETURN "application/font-tdpfr=" +cFname + cFext

ELSEIF cFile LIKE ".+\.frl" ; RETURN "application/freeloader=" +cFname + cFext

ELSEIF cFile LIKE ".+\.spl" ; RETURN "application/futuresplash =" + cFname + cFext

ELSEIF cFile LIKE ".+\.gz" ; RETURN "application/gzip =" + cFname + cFext

ELSEIF cFile LIKE ".+\.stk" ; RETURN "application/hstu =" + cFname + cFext

ELSEIF cFile LIKE ".+\.ips" ; RETURN "application/ips="+cFname + cFext

ELSEIF cFile LIKE ".+\.ptlk" ; RETURN "application/listenup =" + cFname + cFext

ELSEIF cFile LIKE ".+\.hqx" ; RETURN "application/mac-binhex40 =" + cFname + cFext

ELSEIF cFile LIKE ".+\.mbd" ; RETURN "application/mbedlet="+cFname + cFext

ELSEIF cFile LIKE ".+\.mfp" ; RETURN "application/mirage=" +cFname + cFext

ELSEIF cFile LIKE ".+\.(pot|pps|ppt|ppz)" ; RETURN "application/mspowerpoint =" + cFname + cFext

ELSEIF cFile LIKE ".+\.doc" ; RETURN "application/msword=" +cFname + cFext

ELSEIF cFile LIKE ".+\.n2p" ; RETURN "application/n2p="+cFname + cFext

ELSEIF cFile LIKE ".+\.(bin|class|lha|lzh|lzx|dbf)" ; RETURN "application/octet-stream =" + cFname + cFext

ELSEIF cFile LIKE ".+\.oda" ; RETURN "application/oda="+cFname + cFext

ELSEIF cFile LIKE ".+\.axs" ; RETURN "application/olescript=" + cFname + cFext

ELSEIF cFile LIKE ".+\.zpa" ; RETURN "application/pcphoto="+cFname + cFext

ELSEIF cFile LIKE ".+\.pdf" ; RETURN "application/pdf="+cFname + cFext

ELSEIF cFile LIKE ".+\.(ai|eps|ps)" ; RETURN "application/postscript=" +cFname + cFext

ELSEIF cFile LIKE ".+\.shw" ; RETURN "application/presentations=" + cFname + cFext

ELSEIF cFile LIKE ".+\.qrt" ; RETURN "application/quest=" + cFname + cFext

ELSEIF cFile LIKE ".+\.rtc" ; RETURN "application/rtc="+cFname + cFext

ELSEIF cFile LIKE ".+\.rtf" ; RETURN "application/rtf="+cFname + cFext

ELSEIF cFile LIKE ".+\.smp" ; RETURN "application/studiom="+cFname + cFext

ELSEIF cFile LIKE ".+\.dst" ; RETURN "application/tajima=" +cFname + cFext

ELSEIF cFile LIKE ".+\.talk" ; RETURN "application/talker=" +cFname + cFext

ELSEIF cFile LIKE ".+\.tbk" ; RETURN "application/toolbook =" + cFname + cFext

ELSEIF cFile LIKE ".+\.vmd" ; RETURN "application/vocaltec-media-desc="+cFname + cFext

ELSEIF cFile LIKE ".+\.vmf" ; RETURN "application/vocaltec-media-file="+cFname + cFext

ELSEIF cFile LIKE ".+\.wri" ; RETURN "application/write=" + cFname + cFext

ELSEIF cFile LIKE ".+\.wid" ; RETURN "application/x-DemoShield =" + cFname + cFext

ELSEIF cFile LIKE ".+\.rrf" ; RETURN "application/x-InstallFromTheWeb="+cFname + cFext

ELSEIF cFile LIKE ".+\.wis" ; RETURN "application/x-InstallShield="+cFname + cFext

ELSEIF cFile LIKE ".+\.ins" ; RETURN "application/x-NET-Install=" + cFname + cFext

ELSEIF cFile LIKE ".+\.tmv" ; RETURN "application/x-Parable-Thing="+cFname + cFext

ELSEIF cFile LIKE ".+\.arj" ; RETURN "application/x-arj=" + cFname + cFext

ELSEIF cFile LIKE ".+\.asp" ; RETURN "application/x-asap=" +cFname + cFext

ELSEIF cFile LIKE ".+\.aab" ; RETURN "application/x-authorware-bin =" + cFname + cFext

ELSEIF cFile LIKE ".+\.(aam|aas)" ; RETURN "application/x-authorware-map =" + cFname + cFext

ELSEIF cFile LIKE ".+\.bcpio" ; RETURN "application/x-bcpio="+cFname + cFext

ELSEIF cFile LIKE ".+\.vcd" ; RETURN "application/x-cdlink =" + cFname + cFext

ELSEIF cFile LIKE ".+\.chat" ; RETURN "application/x-chat=" +cFname + cFext

ELSEIF cFile LIKE ".+\.cnc" ; RETURN "application/x-cnc=" + cFname + cFext

ELSEIF cFile LIKE ".+\.(coda|page)" ; RETURN "application/x-coda=" +cFname + cFext

ELSEIF cFile LIKE ".+\.z" ; RETURN "application/x-compress=" +cFname + cFext

ELSEIF cFile LIKE ".+\.con" ; RETURN "application/x-connector="+cFname + cFext

ELSEIF cFile LIKE ".+\.cpio" ; RETURN "application/x-cpio=" +cFname + cFext

ELSEIF cFile LIKE ".+\.pqf" ; RETURN "application/x-cprplayer="+cFname + cFext

ELSEIF cFile LIKE ".+\.csh" ; RETURN "application/x-csh=" + cFname + cFext

ELSEIF cFile LIKE ".+\.(cu|csm)" ; RETURN "application/x-cu-seeme=" +cFname + cFext

ELSEIF cFile LIKE ".+\.(dcr|dir|dxr|swa)" ; RETURN "application/x-director=" +cFname + cFext

ELSEIF cFile LIKE ".+\.dvi" ; RETURN "application/x-dvi=" + cFname + cFext

ELSEIF cFile LIKE ".+\.evy" ; RETURN "application/x-envoy="+cFname + cFext

ELSEIF cFile LIKE ".+\.ebk" ; RETURN "application/x-expandedbook=" +cFname + cFext

ELSEIF cFile LIKE ".+\.gtar" ; RETURN "application/x-gtar=" +cFname + cFext

ELSEIF cFile LIKE ".+\.hdf" ; RETURN "application/x-hdf=" + cFname + cFext

ELSEIF cFile LIKE ".+\.map" ; RETURN "application/x-httpd-imap =" + cFname + cFext

ELSEIF cFile LIKE ".+\.phtml" ; RETURN "application/x-httpd-php="+cFname + cFext

ELSEIF cFile LIKE ".+\.php3" ; RETURN "application/x-httpd-php3 =" + cFname + cFext

ELSEIF cFile LIKE ".+\.ica" ; RETURN "application/x-ica=" + cFname + cFext

ELSEIF cFile LIKE ".+\.ipx" ; RETURN "application/x-ipix=" +cFname + cFext

ELSEIF cFile LIKE ".+\.ips" ; RETURN "application/x-ipscript=" +cFname + cFext

ELSEIF cFile LIKE ".+\.js" ; RETURN "application/x-javascript =" + cFname + cFext

ELSEIF cFile LIKE ".+\.latex" ; RETURN "application/x-latex="+cFname + cFext

ELSEIF cFile LIKE ".+\.bin" ; RETURN "application/x-macbinary="+cFname + cFext

ELSEIF cFile LIKE ".+\.mif" ; RETURN "application/x-mif=" + cFname + cFext

ELSEIF cFile LIKE ".+\.(mpl|mpire)" ; RETURN "application/x-mpire="+cFname + cFext

ELSEIF cFile LIKE ".+\.adr" ; RETURN "application/x-msaddr =" + cFname + cFext

ELSEIF cFile LIKE ".+\.wlt" ; RETURN "application/x-mswallet=" +cFname + cFext

ELSEIF cFile LIKE ".+\.(nc|cdf)" ; RETURN "application/x-netcdf =" + cFname + cFext

ELSEIF cFile LIKE ".+\.npx" ; RETURN "application/x-netfpx =" + cFname + cFext

ELSEIF cFile LIKE ".+\.nsc" ; RETURN "application/x-nschat =" + cFname + cFext

ELSEIF cFile LIKE ".+\.pgp" ; RETURN "application/x-pgp-plugin =" + cFname + cFext

ELSEIF cFile LIKE ".+\.css" ; RETURN "application/x-pointplus="+cFname + cFext

ELSEIF cFile LIKE ".+\.sh" ; RETURN "application/x-sh =" + cFname + cFext

ELSEIF cFile LIKE ".+\.shar" ; RETURN "application/x-shar=" +cFname + cFext

ELSEIF cFile LIKE ".+\.swf" ; RETURN "application/x-shockwave-flash=" + cFname + cFext

ELSEIF cFile LIKE ".+\.spr" ; RETURN "application/x-sprite =" + cFname + cFext

ELSEIF cFile LIKE ".+\.sprite" ; RETURN "application/x-sprite =" + cFname + cFext

ELSEIF cFile LIKE ".+\.sit" ; RETURN "application/x-stuffit=" + cFname + cFext

ELSEIF cFile LIKE ".+\.sca" ; RETURN "application/x-supercard="+cFname + cFext

ELSEIF cFile LIKE ".+\.sv4cpio" ; RETURN "application/x-sv4cpio=" + cFname + cFext

ELSEIF cFile LIKE ".+\.sv4crc" ; RETURN "application/x-sv4crc =" + cFname + cFext

ELSEIF cFile LIKE ".+\.tar" ; RETURN "application/x-tar=" + cFname + cFext

ELSEIF cFile LIKE ".+\.tcl" ; RETURN "application/x-tcl=" + cFname + cFext

ELSEIF cFile LIKE ".+\.tex" ; RETURN "application/x-tex=" + cFname + cFext

ELSEIF cFile LIKE ".+\.(texinfo|texi)" ; RETURN "application/x-texinfo=" + cFname + cFext

ELSEIF cFile LIKE ".+\.tlk" ; RETURN "application/x-tlk=" + cFname + cFext

ELSEIF cFile LIKE ".+\.(t|tr|roff)" ; RETURN "application/x-troff="+cFname + cFext

ELSEIF cFile LIKE ".+\.man" ; RETURN "application/x-troff-man="+cFname + cFext

ELSEIF cFile LIKE ".+\.me" ; RETURN "application/x-troff-me=" +cFname + cFext

ELSEIF cFile LIKE ".+\.ms" ; RETURN "application/x-troff-ms=" +cFname + cFext

ELSEIF cFile LIKE ".+\.alt" ; RETURN "application/x-up-alert=" +cFname + cFext

ELSEIF cFile LIKE ".+\.che" ; RETURN "application/x-up-cacheop =" + cFname + cFext

ELSEIF cFile LIKE ".+\.ustar" ; RETURN "application/x-ustar="+cFname + cFext

ELSEIF cFile LIKE ".+\.src" ; RETURN "application/x-wais-source=" + cFname + cFext

ELSEIF cFile LIKE ".+\.xls" ; RETURN "application/xls="+cFname + cFext

ELSEIF cFile LIKE ".+\.xlt" ; RETURN "application/xlt="+cFname + cFext

ELSEIF cFile LIKE ".+\.zip" ; RETURN "application/zip="+cFname + cFext

ELSEIF cFile LIKE ".+\.(au|snd)" ; RETURN "audio/basic="+cFname + cFext

ELSEIF cFile LIKE ".+\.es" ; RETURN "audio/echospeech =" + cFname + cFext

ELSEIF cFile LIKE ".+\.(gsm|gsd)" ; RETURN "audio/gsm=" + cFname + cFext

ELSEIF cFile LIKE ".+\.rmf" ; RETURN "audio/rmf=" + cFname + cFext

ELSEIF cFile LIKE ".+\.tsi" ; RETURN "audio/tsplayer=" +cFname + cFext

ELSEIF cFile LIKE ".+\.vox" ; RETURN "audio/voxware=" + cFname + cFext

ELSEIF cFile LIKE ".+\.wtx" ; RETURN "audio/wtx=" + cFname + cFext

ELSEIF cFile LIKE ".+\.(aif|aiff|aifc)" ; RETURN "audio/x-aiff =" + cFname + cFext

ELSEIF cFile LIKE ".+\.(cht|dus)" ; RETURN "audio/x-dspeech="+cFname + cFext

ELSEIF cFile LIKE ".+\.(mid|midi)" ; RETURN "audio/x-midi =" + cFname + cFext

ELSEIF cFile LIKE ".+\.mp3" ; RETURN "audio/x-mpeg =" + cFname + cFext

ELSEIF cFile LIKE ".+\.mp2" ; RETURN "audio/x-mpeg =" + cFname + cFext

ELSEIF cFile LIKE ".+\.m3u" ; RETURN "audio/x-mpegurl="+cFname + cFext

ELSEIF cFile LIKE ".+\.(ram|ra)" ; RETURN "audio/x-pn-realaudio =" + cFname + cFext

ELSEIF cFile LIKE ".+\.rpm" ; RETURN "audio/x-pn-realaudio-plugin="+cFname + cFext

ELSEIF cFile LIKE ".+\.stream" ; RETURN "audio/x-qt-stream=" + cFname + cFext

ELSEIF cFile LIKE ".+\.rmf" ; RETURN "audio/x-rmf="+cFname + cFext

ELSEIF cFile LIKE ".+\.(vqf|vql)" ; RETURN "audio/x-twinvq=" +cFname + cFext

ELSEIF cFile LIKE ".+\.vqe" ; RETURN "audio/x-twinvq-plugin=" + cFname + cFext

ELSEIF cFile LIKE ".+\.wav" ; RETURN "audio/x-wav="+cFname + cFext

ELSEIF cFile LIKE ".+\.wtx" ; RETURN "audio/x-wtx="+cFname + cFext

ELSEIF cFile LIKE ".+\.mol" ; RETURN "chemical/x-mdl-molfile=" +cFname + cFext

ELSEIF cFile LIKE ".+\.pdb" ; RETURN "chemical/x-pdb=" +cFname + cFext

ELSEIF cFile LIKE ".+\.dwf" ; RETURN "drawing/x-dwf=" + cFname + cFext

ELSEIF cFile LIKE ".+\.ivr" ; RETURN "i-world/i-vrml=" +cFname + cFext

ELSEIF cFile LIKE ".+\.cod" ; RETURN "image/cis-cod=" + cFname + cFext

ELSEIF cFile LIKE ".+\.cpi" ; RETURN "image/cpi=" + cFname + cFext

ELSEIF cFile LIKE ".+\.fif" ; RETURN "image/fif=" + cFname + cFext

ELSEIF cFile LIKE ".+\.gif" ; RETURN "image/gif=" + cFname + cFext

ELSEIF cFile LIKE ".+\.ief" ; RETURN "image/ief=" + cFname + cFext

ELSEIF cFile LIKE ".+\.(jpeg|jpg|jpe)" ; RETURN "image/jpeg=" +cFname + cFext

ELSEIF cFile LIKE ".+\.rip" ; RETURN "image/rip=" + cFname + cFext

ELSEIF cFile LIKE ".+\.svh" ; RETURN "image/svh=" + cFname + cFext

ELSEIF cFile LIKE ".+\.(tiff|tif)" ; RETURN "image/tiff=" +cFname + cFext

ELSEIF cFile LIKE ".+\.mcf" ; RETURN "image/vasa=" +cFname + cFext

ELSEIF cFile LIKE ".+\.(svf|dwg|dxf)" ; RETURN "image/vnd=" + cFname + cFext

ELSEIF cFile LIKE ".+\.wi" ; RETURN "image/wavelet=" + cFname + cFext

ELSEIF cFile LIKE ".+\.ras" ; RETURN "image/x-cmu-raster=" +cFname + cFext

ELSEIF cFile LIKE ".+\.etf" ; RETURN "image/x-etf="+cFname + cFext

ELSEIF cFile LIKE ".+\.fpx" ; RETURN "image/x-fpx="+cFname + cFext

ELSEIF cFile LIKE ".+\.(fh5|fh4|fhc)" ; RETURN "image/x-freehand =" + cFname + cFext

ELSEIF cFile LIKE ".+\.dsf" ; RETURN "image/x-mgx-dsf="+cFname + cFext

ELSEIF cFile LIKE ".+\.pnm" ; RETURN "image/x-portable-anymap="+cFname + cFext

ELSEIF cFile LIKE ".+\.pbm" ; RETURN "image/x-portable-bitmap="+cFname + cFext

ELSEIF cFile LIKE ".+\.pgm" ; RETURN "image/x-portable-graymap =" + cFname + cFext

ELSEIF cFile LIKE ".+\.ppm" ; RETURN "image/x-portable-pixmap="+cFname + cFext

ELSEIF cFile LIKE ".+\.rgb" ; RETURN "image/x-rgb="+cFname + cFext

ELSEIF cFile LIKE ".+\.xbm" ; RETURN "image/x-xbitmap="+cFname + cFext

ELSEIF cFile LIKE ".+\.xpm" ; RETURN "image/x-xpixmap="+cFname + cFext

ELSEIF cFile LIKE ".+\.xwd" ; RETURN "image/x-xwindowdump="+cFname + cFext

ELSEIF cFile LIKE ".+\.dig" ; RETURN "multipart/mixed="+cFname + cFext

ELSEIF cFile LIKE ".+\.push" ; RETURN "multipart/x-mixed-replace=" + cFname + cFext

ELSEIF cFile LIKE ".+\.(wan|waf)" ; RETURN "plugin/wanimate="+cFname + cFext

ELSEIF cFile LIKE ".+\.ccs" ; RETURN "text/ccs =" + cFname + cFext

ELSEIF cFile LIKE ".+\.(htm|html)" ; RETURN "text/html=" + cFname + cFext

ELSEIF cFile LIKE ".+\.pgr" ; RETURN "text/parsnegar-document="+cFname + cFext

ELSEIF cFile LIKE ".+\.txt" ; RETURN "text/plain=" +cFname + cFext

ELSEIF cFile LIKE ".+\.rtx" ; RETURN "text/richtext=" + cFname + cFext

ELSEIF cFile LIKE ".+\.tsv" ; RETURN "text/tab-separated-values=" + cFname + cFext

ELSEIF cFile LIKE ".+\.hdml" ; RETURN "text/x-hdml="+cFname + cFext

ELSEIF cFile LIKE ".+\.etx" ; RETURN "text/x-setext=" + cFname + cFext

ELSEIF cFile LIKE ".+\.(talk|spc)" ; RETURN "text/x-speech=" + cFname + cFext

ELSEIF cFile LIKE ".+\.afl" ; RETURN "video/animaflex="+cFname + cFext

ELSEIF cFile LIKE ".+\.(mpeg|mpg|mpe)" ; RETURN "video/mpeg=" +cFname + cFext

ELSEIF cFile LIKE ".+\.(qt|mov)" ; RETURN "video/quicktime="+cFname + cFext

ELSEIF cFile LIKE ".+\.(viv|vivo)" ; RETURN "video/vnd.vivo=" +cFname + cFext

ELSEIF cFile LIKE ".+\.(asf|asx)" ; RETURN "video/x-ms-asf=" +cFname + cFext

ELSEIF cFile LIKE ".+\.avi" ; RETURN "video/x-msvideo="+cFname + cFext

ELSEIF cFile LIKE ".+\.movie" ; RETURN "video/x-sgi-movie=" + cFname + cFext

ELSEIF cFile LIKE ".+\.(vgm|vgx|xdr)" ; RETURN "video/x-videogram=" + cFname + cFext

ELSEIF cFile LIKE ".+\.vgp" ; RETURN "video/x-videogram-plugin =" + cFname + cFext

ELSEIF cFile LIKE ".+\.vts" ; RETURN "workbook/formulaone="+cFname + cFext

ELSEIF cFile LIKE ".+\.vtts" ; RETURN "workbook/formulaone="+cFname + cFext

ELSEIF cFile LIKE ".+\.(3dmf|3dm|qd3d|qd3)" ; RETURN "x-world/x-3dmf=" +cFname + cFext

ELSEIF cFile LIKE ".+\.svr" ; RETURN "x-world/x-svr=" + cFname + cFext

ELSEIF cFile LIKE ".+\.(wrl|wrz)" ; RETURN "x-world/x-vrml=" +cFname + cFext

ELSEIF cFile LIKE ".+\.vrt" ; RETURN "x-world/x-vrt=" + cFname + cFext

ENDIF

RETURN "text/plain;filename=" + cFname + cFext

Pompeo

Guaratinguetá - SP

(12) 9777-9386

E-Mail: mkyx@ig.com.br

MSN: mkyx@ig.com.br

Skype: pardes.mky

www.adentech.com.br

www.rmahost.com

xH 1.1.0 Hb 8.02 - BCC 55

Editado por - mkyx on 06/10/2009 18:24:57

Link to comment
Share on other sites

citação:

Abra o banco onde esta o email e ponha o PONTEIRO em cima do cliente que tem email:


//-> Pegando o Email do Cliente do Banco de dados CADCLIEN.DBF

EmailCliente := LOWER(ALLTRIM( CADCLIEN->EMAILNFE ) )

//-> Transformo para ficar igual ao exemplo

aRecipients := { EmailCliente } //-> email final para enviar

id=code>id=code>

João Santos - São Paulo.

kmt_karinha@pop.com.br

kapiaba@brfree.com.br

Fone: (11) 3106-2832

FWH 2.7 - xHARBOUR 0.99.61 - WorkShop.Exe


id=quote>id=quote>

kapiaba olha so o jeito que estou fazendo...

a minha ES ta recebendo o email... que esta na edit certo ai coloquei aReceipt:=ES porem o programa roda mas o email nao vai para o campo PARA do email..

deste jeito esta errado??


Local oMail

ES=email

? ES

Define Mail oMail;

Subject "Digite aqui o Assunto...";

Text "Digite aqui o Texto de email";

from USER;

aReceipt:= ES

Activate Mail oMail

Return Nil

id=code>id=code>

valews

Obrigado pela ATENÇÃO e AJUDA!

"O homem deve criar as oportunidades e não somente encontrá-las."

Fábio Igor (BH-MG)

fabio.igor@hotmail.com

Iniciante

FWH 2.8

[x]Harbour 9.61

xdev 0.70

WS

Editado por - fabin01 on 07/10/2009 08:47:29

Link to comment
Share on other sites

Uma pergunta, principalmente pro Kapi,

Estou a procura de uma rotina que rotaciona, gira um texto na dialog ou window, da esquerda para a direita ou vice-versa, onde pode conseguir?

Pompeo, como seria isto?? Tipo um BANNER?? Explique melhor.

Abraços.

João Santos - São Paulo.

kmt_karinha@pop.com.br

kapiaba@brfree.com.br

Fone: (11) 3106-2832

FWH 2.7 - xHARBOUR 0.99.61 - WorkShop.Exe

Link to comment
Share on other sites

citação:

aRecipients := { ES } //-> email final para enviar

João Santos - São Paulo.

kmt_karinha@pop.com.br

kapiaba@brfree.com.br

Fone: (11) 3106-2832

FWH 2.7 - xHARBOUR 0.99.61 - WorkShop.Exe


id=quote>id=quote>

kapi aconteceu este erro

id=code>
id=code>

no caso terei que colocar essa linha

id=code>
id=code>

valews

Obrigado pela ATENÇÃO e AJUDA!

"O homem deve criar as oportunidades e não somente encontrá-las."

Fábio Igor (BH-MG)

fabio.igor@hotmail.com

Iniciante

FWH 2.8

[x]Harbour 9.61

xdev 0.70

WS

Link to comment
Share on other sites

citação:

EmailCliente := LOWER(ALLTRIM( CADCLIEN->EMAIL ) )

EMAIL QUE ESTÃ NO SEU BANCO DE DADOS.

João Santos - São Paulo.

kmt_karinha@pop.com.br

kapiaba@brfree.com.br

Fone: (11) 3106-2832

FWH 2.7 - xHARBOUR 0.99.61 - WorkShop.Exe


id=quote>id=quote>

kapi coloquei conforme vc me falou porem erro persiste...

coloqeu o ES antes do define e depois ma ssempre da erro


Local oMail

//ES=email

//? ES

ES:=Lower(alltrim(CADCON->email))

Define Mail oMail;

Subject "Digite aqui o Assunto...";

Text "Digite aqui o Texto de email";

from USER;

aRecipients:={ES}

Activate Mail oMail

Return Nil

id=code>id=code>

o que esta errado??

valews

Obrigado pela ATENÇÃO e AJUDA!

"O homem deve criar as oportunidades e não somente encontrá-las."

Fábio Igor (BH-MG)

fabio.igor@hotmail.com

Iniciante

FWH 2.8

[x]Harbour 9.61

xdev 0.70

WS

Link to comment
Share on other sites

eu estava achando que era do samples que nos estavamos falando...pelo menos eu estava usando a rotina do samples pq como vc disse realmnete ela é facil porem nao conseguir colocar o email da pessoa nocampo PARA mas vou dar uma lida entao na sua rotina la ok...

valews

Obrigado pela ATENÇÃO e AJUDA!

"O homem deve criar as oportunidades e não somente encontrá-las."

Fábio Igor (BH-MG)

fabio.igor@hotmail.com

Iniciante

FWH 2.8

[x]Harbour 9.61

xdev 0.70

WS

Link to comment
Share on other sites

Fábio, eu concordo com o Kapiaba, sem ler, nunca vai aprender. Eu gastei uns 10 segundos vendo o MAIL.CH no include e já vi onde você está errando.

Olhe o include ou a classe TMAIL que mata na hora (ou não).

Nessas horas, saber OO é muito importante.

Luis Fernando Jr.(Luisão)

"Seize the day or die regretting the time you lost"

FWH8.1 + SQLLIB 1.9d + xHB 1.10 + xDev 0.65 + @SAY

Link to comment
Share on other sites

citação:

Fábio, eu concordo com o Kapiaba, sem ler, nunca vai aprender. Eu gastei uns 10 segundos vendo o MAIL.CH no include e já vi onde você está errando.

Olhe o include ou a classe TMAIL que mata na hora (ou não).

Nessas horas, saber OO é muito importante.

Luis Fernando Jr.(Luisão)

"Seize the day or die regretting the time you lost"

FWH8.1 + SQLLIB 1.9d + xHB 1.10 + xDev 0.65 + @SAY


id=quote>id=quote>

a certoooo....

achave eu que nao tinha como abrir os arquivos .ch nao...

entao eles mostram a estrutura neh

agora deu certo

ao inves de colocar receipt coloquei to ao preencheu so que é o seguinte

coloque ES recebendo o email so que no campo Para apareceu literalmente ES acho que devido as "" como faço para sair o valor da variavel??


Local oMail

ES=email

Define Mail oMail;

Subject "Digite aqui o Assunto...";

Text "Digite aqui o Texto de email";

from USER;

ORIGiN "solution@solutionbh.com.br";

TO "ES"

Activate Mail oMail

Return Nil

id=code>id=code>

valews

Obrigado pela ATENÇÃO e AJUDA!

"O homem deve criar as oportunidades e não somente encontrá-las."

Fábio Igor (BH-MG)

fabio.igor@hotmail.com

Iniciante

FWH 2.8

[x]Harbour 9.61

xdev 0.70

WS

Editado por - fabin01 on 07/10/2009 10:39:50

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...