Agora sim, funciona perfeitamente. Só não se vai funcionar se não tiver outlook express/Windows Live mail Instalado.
// Testing FiveWin new Internet Outgoing mail (SMTP protocol) Class
// Baseado no exemplo: C:\FWH1306\SAMPLES\TESTSMTP.PRG
// Special Thanks: Vagner Wirts.
#include "FiveWin.ch"
static oWnd
//----------------------------------------------------------------------------//
FUNCTION Main()
local oBar
DEFINE WINDOW oWnd TITLE "Sending Internet Mail from FiveWin"
DEFINE BUTTONBAR oBar _3D OF oWnd
DEFINE BUTTON OF oBar ACTION SendMail() TOOLTIP "Send Mail"
SET MESSAGE OF oWnd TO "Ready" NOINSET DATE TIME KEYBOARD
ACTIVATE WINDOW oWnd
return nil
//----------------------------------------------------------------------------//
FUNCTION SendMail()
local oOutMail, cIP, nPort, lAuth, cUser, cPassword, cIPServer
Default nPort := 587, ;
lAuth := .T., ; // Obrigatorio ser .T. no meu caso.
cUser := "joao@pleno.com.br", ;
cPassword := "MISENHA", ;
cIPServer := ""
oWnd:SetMsg( "Envio de Email Via Internet..." )
WSAStartup()
// Classe: TSMPT.PRG
//METHOD New( cIPServer, nPort, lAuth, cUser, cPassword ) CONSTRUCTOR
oOutMail := TSmtp():New( cIPServer := GetHostByName( "smtp.pleno.com.br" ) )
oOutMail := TSmtp():New( cIPServer, nPort, lAuth, cUser, cPassword )
MsgInfo( cIPServer ) // cIP
oOutMail:bConnecting = { || oWnd:SetMsg( "Conectando ao smtp.pleno.com.br..." ) }
oOutMail:bConnected = { || oWnd:SetMsg( "Conectado" ) }
oOutMail:bDone = { || oWnd:SetMsg( "Mensagem Enviada com Sucesso" ) }
oOutMail:SendMail( "joao@pleno.com.br",; // From
{ "joao@pleno.com.br" },; // To
"Mensagens de Erros do Programa",; // Msg Text
"*** CONTROLE DE ERROS ***",; // Subject
{ "error.log" } ) // attached files
// { "error.log", "testsmtp.zip" } ) // attached files
RETURN NIL
//----------------------------------------------------------------------------//