testsmtp

Post Reply
User avatar
kajot
Posts: 309
Joined: Thu Nov 02, 2006 6:53 pm
Location: Poland

testsmtp

Post by kajot »

what is wrong
I send mail form inkom@hot.pl to inkom.kj@wp.pl , everything is ok but I will get mail ( from inkom@hot.pl to inkom.kj@wp.pl)


// Testing FiveWin new Internet Outgoing mail (SMTP protocol) Class

#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

oWnd:SetMsg( "Sending Internet email..." )

WSAStartup()
oOutMail := TSmtp():New( cIP := GetHostByName( "hot.pl" ) )
MsgInfo( cIP )

oOutMail:bConnecting = { || oWnd:SetMsg( "Connecting to hot.pl..." ) }
oOutMail:bConnected = { || oWnd:SetMsg( "Connected" ) }
oOutMail:bDone = { || oWnd:SetMsg( "Message sent successfully" ) }

oOutMail:SendMail( "inkom@hot.pl",; // From
{ "inkom.kj@wp.pl" },; // To
"It is working!!!",; // Msg Text
"Testing FiveWin Class TSmtp enhancements",; // Subject
{ "testsmtp.prg" } ) // attached files

return nil

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

procedure AppSys // Xbase++ requirement

return

//----------------------------------------------------------------------------//
best regards
kajot
Post Reply