Eu gostaria de saber como faço para poder mandar um e-mail pelo programa, se for possivel.
Mandar e-mail pelo programa?
Moderador: Moderadores
Mandar e-mail pelo programa?
Alguem poderia me ajudar?
Eu gostaria de saber como faço para poder mandar um e-mail pelo programa, se for possivel.

Eu gostaria de saber como faço para poder mandar um e-mail pelo programa, se for possivel.
-
culik
Ola
com xharbour e nada mais que
FUNC main
local n
? SendMail( [smtp.brturbo.com.br],,[culikr@brturbo.com.br] , {[culikr@brturbo.com.br]},[Erro], [Error.log],{'teste.zip'} , [xxxxxxxx], [xxxxxxxxxxxxxx],[pop.brturbo.com.br],,,.t.,.t.)
[]s
Luiz
com xharbour e nada mais que
FUNC main
local n
? SendMail( [smtp.brturbo.com.br],,[culikr@brturbo.com.br] , {[culikr@brturbo.com.br]},[Erro], [Error.log],{'teste.zip'} , [xxxxxxxx], [xxxxxxxxxxxxxx],[pop.brturbo.com.br],,,.t.,.t.)
[]s
Luiz
Prezado Colega
Como você postou na seção Clipper desconfio que você deseja fazer isso utilizando programação em Clipper.
Você pode usar o SMTPSEND para isso. A sintaxe é a seguinte :
SMTPSEND -@ARQUIVO
Onde ARQUIVO é o arquivo de comandos a serem enviados, abaixo segue um exemplo de um arquivo de paramentros :
-fmarcelo @ sistemabr.com.br
-tmmendeso @ ig.com.br
-sTeste do SMTPSEND
-aTESTE.ABC
-iMSG.TXT
-hsmtp.sistemabr.com.br
Neste caso
F = Remetente
T = Destinatário
S = Assunto
A = Arquivo a ser anexado (são permitidos caracteres coringas)
I = Mensagem do email
H = Nome do servidor SMTP
Para usar autenticação :
-umarcelo
-p123456
Onde :
U = Nome do usuário para autenticação
P = Senha
Para criar o arquivo de parâmetros você pode usar a função MEMOWRIT()
Se quiser o SMTPSEND é só entrar em contato que terei prazer em lhe enviar.
Se precisar de uma função para testar se a conexão com a internet está ativa use a função abaixo :
http://geocities.yahoo.com.br/mmendeso/pinga.zip
Até logo.
Marcelo
Como você postou na seção Clipper desconfio que você deseja fazer isso utilizando programação em Clipper.
Você pode usar o SMTPSEND para isso. A sintaxe é a seguinte :
SMTPSEND -@ARQUIVO
Onde ARQUIVO é o arquivo de comandos a serem enviados, abaixo segue um exemplo de um arquivo de paramentros :
-fmarcelo @ sistemabr.com.br
-tmmendeso @ ig.com.br
-sTeste do SMTPSEND
-aTESTE.ABC
-iMSG.TXT
-hsmtp.sistemabr.com.br
Neste caso
F = Remetente
T = Destinatário
S = Assunto
A = Arquivo a ser anexado (são permitidos caracteres coringas)
I = Mensagem do email
H = Nome do servidor SMTP
Para usar autenticação :
-umarcelo
-p123456
Onde :
U = Nome do usuário para autenticação
P = Senha
Para criar o arquivo de parâmetros você pode usar a função MEMOWRIT()
Se quiser o SMTPSEND é só entrar em contato que terei prazer em lhe enviar.
Se precisar de uma função para testar se a conexão com a internet está ativa use a função abaixo :
http://geocities.yahoo.com.br/mmendeso/pinga.zip
Até logo.
Marcelo
Programador que é programador, quando tá de folga vai inventar função nova, fazer testes, ou seja... se divertir
Cobra 210 - Drive de 8" 1.024 KB - 64 KB RAM - Impressora de Linha Cobra - Visicalc - Fortran - Dialog - Sistema Operacional SP/M (é sp/m mesmo - era o cp/m da cobra)
Cobra 210 - Drive de 8" 1.024 KB - 64 KB RAM - Impressora de Linha Cobra - Visicalc - Fortran - Dialog - Sistema Operacional SP/M (é sp/m mesmo - era o cp/m da cobra)
-
Visitante
Deixa eu puxar a sardinha... hehehe
O PageScript 4 tem uma função para envio de e-mails, a PSSendmail.
Segue abaixo a sintaxe da mesma:
PSSendMail()
--------------------------------------------------------------------------------
Syntax
PSSendMail(<aHost>, <aMessage>)
Returns
An array of two elements. The first element is true if any error occured during the call to PSSendMail, otherwise, false is returned. The second element contains a character string with the message returned by the call to PSSendMail().
Description
Use PSSendMail() to send simple eMails (subject and body), in text only format. The functions requires two parameters. The first one is an array of 5 elements containing the HOST part and the second parameter is an array of 5 elements containing the MESSAGE part. These array elements are defined in PSMail.ch, which is described below.
Arguments
<aHost> Array containing the host structure.
<aMessage> Array containing the message structure.
PSMail.ch, array definition
Constant Example Type Description
Host array
APH_HOST "smtp.myhost.net" Char This is the host smtp address
APH_PORT 25 Num smtp Port number. Normaly 25. Defaults to 25.
APH_USERNAME "myusername" Char Your username to access the host smtp server
APH_PASSWORD "mypassword" Char Your password to access the host smtp server, if required.
APH_MAILAGENT "PSMailer" Char The name of the mail agent. Defaults to PSMailer.
Message array
APM_FROMMAIL {"martinrw@myserver.com", "Richard W Martin"} Array of Char A two elements array. The first element of the array is your email address and the second array element is your full name. The second element may be an empty string.
APM_TOMAIL {"mrecipient@server.net", "Mr. recipient"} Array of Char A two elements array. The first element of the array is the email address of the recipient and the second array element is the full name. The second element may be an empty string.
APM_SUBJECT "PageScript" Char The subject or the message. May not be empty.
APM_BODY "Dear sir," + CRLF2 + "Let me tell you about..." Char The body part of the message. May contain only characters and CR/LF, no control characters.
APM_PRIORITY 5 Num Priority of the message. Defaults to normal priority (3 - APP_NORMAL).
Priority constants
APP_HIGHEST n/a Num Highest priority.
APP_HIGH n/a Num High priority.
APP_NORMAL n/a Num Normal priority (default for APM_PRIORITY).
APP_LOW n/a Num Low priority.
APP_LOWEST n/a Num Lowest priority.
Example
#include "PSMail.ch"
Local aHost[APH_TOTAL]
Local aMessage[APM_TOTAL]
Local aReturn
aHost[APH_HOST] := "smtp.myserver.net"
aHost[APH_PORT] := 21 // Not required
aHost[APH_USERNAME] := "myusername"
aHost[APH_PASSWORD] := "" // Not required
aHost[APH_MAILAGENT] := "" // Not required
aMessage[APM_FROMMAIL] := {"rm@myserver.net, "Richard W Martin"}
aMessage[APM_TOMAIL] := {"you@yourserver.com", "You Yourself"}
aMessage[APM_SUBJECT] := "PageScript 4"
aMessage[APM_BODY] := "Let me tell you why PageScript is so wonderful..."
aMessage[APM_PRIORITY] := APP_NORMAL // Not required
aReturn := PSSendMail(aHost, aMessage)
if aReturn[1]
Alert(aReturn[2])
endif
Um Clip Abraço
O PageScript 4 tem uma função para envio de e-mails, a PSSendmail.
Segue abaixo a sintaxe da mesma:
PSSendMail()
--------------------------------------------------------------------------------
Syntax
PSSendMail(<aHost>, <aMessage>)
Returns
An array of two elements. The first element is true if any error occured during the call to PSSendMail, otherwise, false is returned. The second element contains a character string with the message returned by the call to PSSendMail().
Description
Use PSSendMail() to send simple eMails (subject and body), in text only format. The functions requires two parameters. The first one is an array of 5 elements containing the HOST part and the second parameter is an array of 5 elements containing the MESSAGE part. These array elements are defined in PSMail.ch, which is described below.
Arguments
<aHost> Array containing the host structure.
<aMessage> Array containing the message structure.
PSMail.ch, array definition
Constant Example Type Description
Host array
APH_HOST "smtp.myhost.net" Char This is the host smtp address
APH_PORT 25 Num smtp Port number. Normaly 25. Defaults to 25.
APH_USERNAME "myusername" Char Your username to access the host smtp server
APH_PASSWORD "mypassword" Char Your password to access the host smtp server, if required.
APH_MAILAGENT "PSMailer" Char The name of the mail agent. Defaults to PSMailer.
Message array
APM_FROMMAIL {"martinrw@myserver.com", "Richard W Martin"} Array of Char A two elements array. The first element of the array is your email address and the second array element is your full name. The second element may be an empty string.
APM_TOMAIL {"mrecipient@server.net", "Mr. recipient"} Array of Char A two elements array. The first element of the array is the email address of the recipient and the second array element is the full name. The second element may be an empty string.
APM_SUBJECT "PageScript" Char The subject or the message. May not be empty.
APM_BODY "Dear sir," + CRLF2 + "Let me tell you about..." Char The body part of the message. May contain only characters and CR/LF, no control characters.
APM_PRIORITY 5 Num Priority of the message. Defaults to normal priority (3 - APP_NORMAL).
Priority constants
APP_HIGHEST n/a Num Highest priority.
APP_HIGH n/a Num High priority.
APP_NORMAL n/a Num Normal priority (default for APM_PRIORITY).
APP_LOW n/a Num Low priority.
APP_LOWEST n/a Num Lowest priority.
Example
#include "PSMail.ch"
Local aHost[APH_TOTAL]
Local aMessage[APM_TOTAL]
Local aReturn
aHost[APH_HOST] := "smtp.myserver.net"
aHost[APH_PORT] := 21 // Not required
aHost[APH_USERNAME] := "myusername"
aHost[APH_PASSWORD] := "" // Not required
aHost[APH_MAILAGENT] := "" // Not required
aMessage[APM_FROMMAIL] := {"rm@myserver.net, "Richard W Martin"}
aMessage[APM_TOMAIL] := {"you@yourserver.com", "You Yourself"}
aMessage[APM_SUBJECT] := "PageScript 4"
aMessage[APM_BODY] := "Let me tell you why PageScript is so wonderful..."
aMessage[APM_PRIORITY] := APP_NORMAL // Not required
aReturn := PSSendMail(aHost, aMessage)
if aReturn[1]
Alert(aReturn[2])
endif
Um Clip Abraço
caro amigo CLIPPER.
ja consegui o programa smtp!
mas não consegui enviar aparece um erro mais ou menos assim:
error: unable to convert hostname to ip address ( no answer from ns ) [3].
Ate agora muito obrigado!
mas não consegui enviar aparece um erro mais ou menos assim:
error: unable to convert hostname to ip address ( no answer from ns ) [3].
Ate agora muito obrigado!
-
Dudu_XBase
- Membro Master

- Mensagens: 1071
- Registrado em: 25 Ago 2003 16:55
-
spereira
- Usuário Nível 2

- Mensagens: 85
- Registrado em: 19 Jul 2004 11:42
- Localização: Porto - Portugal
Olá Marcelo,Clipper escreveu:Prezado Colega
Como você postou na seção Clipper desconfio que você deseja fazer isso utilizando programação em Clipper.
Você pode usar o SMTPSEND para isso. A sintaxe é a seguinte :
SMTPSEND -@ARQUIVO
Onde ARQUIVO é o arquivo de comandos a serem enviados, abaixo segue um exemplo de um arquivo de paramentros :
-fmarcelo @ sistemabr.com.br
-tmmendeso @ ig.com.br
-sTeste do SMTPSEND
-aTESTE.ABC
-iMSG.TXT
-hsmtp.sistemabr.com.br
Neste caso
F = Remetente
T = Destinatário
S = Assunto
A = Arquivo a ser anexado (são permitidos caracteres coringas)
I = Mensagem do email
H = Nome do servidor SMTP
Para usar autenticação :
-umarcelo
-p123456
Onde :
U = Nome do usuário para autenticação
P = Senha
Para criar o arquivo de parâmetros você pode usar a função MEMOWRIT()
Se quiser o SMTPSEND é só entrar em contato que terei prazer em lhe enviar.
Se precisar de uma função para testar se a conexão com a internet está ativa use a função abaixo :
http://geocities.yahoo.com.br/mmendeso/pinga.zip
Até logo.
Marcelo
A versão do SMTPSEND é gratuíta? Tem que instalar ou basta ter uma conexão ativa da Internet?
Obrigado.
Sérgio Pereira
- rochinha
- Administrador

- Mensagens: 4664
- Registrado em: 18 Ago 2003 20:43
- Localização: São Paulo - Brasil
- Contato:
Amiguinho
Veja também este tópico aqui
Nele vc encontra uma explicação detalhada de como usar programas FREE para enviar e receber email.
Tem explicação de uso dos dois métodos e um código completo para Fivewin que faz parte de meu sistema e que pode ser adapatado para Clipper puro pos utiliza com API a geração de arquivos .TXT para integração com os aplicativos.
Para usar as funções em puro Clipper basta trocar WinEXEC por __RUN e MsgRun por @...SAY.
@braços :?)
Veja também este tópico aqui
Nele vc encontra uma explicação detalhada de como usar programas FREE para enviar e receber email.
Tem explicação de uso dos dois métodos e um código completo para Fivewin que faz parte de meu sistema e que pode ser adapatado para Clipper puro pos utiliza com API a geração de arquivos .TXT para integração com os aplicativos.
Para usar as funções em puro Clipper basta trocar WinEXEC por __RUN e MsgRun por @...SAY.
@braços :?)
- alaminojunior
- Colaborador

- Mensagens: 1717
- Registrado em: 16 Dez 2005 21:26
- Localização: Ubatuba - SP
