Guest_imported
New member
- Jan 1, 1970
- 0
I have looked in the Internet about the SMTP commands. My question: How to make them work within VFP? I'll give one dollar premium for the one who gives the correct answer.
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
#INCLUDE KEYCODE.FOX
#INCLUDE SEE32CON.FOX
DECLARE INTEGER seeAttach in SEE32.DLL INTEGER NbrChans, INTEGER KeyCode
DECLARE INTEGER seeClose in SEE32.DLL INTEGER Chan
DECLARE INTEGER seeErrorText in SEE32.DLL INTEGER Chan, INTEGER Code, STRING
@Buffer,INTEGER BufLen
DECLARE INTEGER seeIntegerParam in SEE32.DLL INTEGER Chan, INTEGER Param,
INTEGER Value
DECLARE INTEGER seeRelease in SEE32.DLL
DECLARE INTEGER seeStringParam in SEE32.DLL INTEGER Chan, INTEGER Param,
STRING @Value
*** PROGRAMMER: Edit these strings [use host name or IP address for server] ***
SmtpServer = "10.0.0.1"
SmtpFrom = "<mike@10.0.0.1>"
SmtpReply = Chr(0)
SmtpTo = "<mike@10.0.0.1>"
DiagFile = "HELLO.LOG"
*** END PROGRAMMER ***
? "HELLO 3/27/2002"
Code = seeAttach(1, SEE_KEY_CODE)
if Code < 0
? "Cannot attach SEE"
return
endif
Code = seeStringParam(0, SEE_LOG_FILE, @DiagFile)
*** set maximum connect wait to 10 seconds
Code = seeIntegerParam(0, SEE_CONNECT_WAIT, 10000)
*** connect to POP3 server
? "Connecting to " + SmtpServer
Code = seeSmtpConnect(0, @SmtpServer, @SmtpFrom, @SmtpReply)
if Code < 0
Temp = SPACE(128)
Code = seeErrorText(0,Code,@Temp,128)
? Left(Temp,Code)
else
*** send email message
? "Sending email to " + SmtpTo
Code = seeSendEmail(0,SmtpTo,"","","This is the subject","Message","")
if Code < 0
Temp = SPACE(128)
Code = seeErrorText(0,Code,@Temp,128)
? Left(Temp,Code)
else
? "Email has been sent."
endif
endif
? "Done."
Code = seeClose(0)
Code = seeRelease()
return
SET CLASSLIB TO wwIPSTUFF ADDITIVE
SET PROCEDURE TO wwUtils ADDITIVE
loIP = CREATEOBJECT("wwIPStuff")
loIP.cMailServer = "your.mailserver.com" && or IP address
loIP.cSenderEmail = "yourname@yours.com"
loIP.cSenderName = "Jimmy Roe "
loIP.cRecipient = "jroe@roe.com "
loIP.cCCList = "jbox@com.com,ttemp@temp.com"
loIP.cBCCList = "somebody@nowhere.com"
loIP.cSubject = "wwIPStuff Test Message"
loIP.cMessage = "Test Message body" + CHR(13)
*loIP.cAttachment = "c:\temp\pkzip.exe"
*** Wait for completion
llResult = loIP.SendMail()
IF !llResult
WAIT WINDOW loIP.cErrorMsg
ELSE
WAIT WINDOW NOWAIT "Message sent..."
ENDIF