Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sending email
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Miscellaneous
Thread ID:
00738818
Message ID:
00745442
Views:
25
>I am trying to use foxpro combined with office 2000 on windows 2000. I can get foxpro to work with word and excel no problem. Now comes the problem, Outlook 2000. I have found the commands, but apparently the security updates to Outlook 2000 now prevent it from sending messages via a third party program (foxpro), even though it is Microsoft, without some user intervension. This is a real pain, especially when trying to wright monitoring software. Anybody know a work around? Any help is appriciated. Thanks
>Mike Burns

Here is a wonderful, simple and fast control I found at http://www.seekfordsolutions.com. You can send email directly from VFP without having to depend on outlook and its annoying message box. The complete package has SMTP, POP3, FTP, HTTP and etc. I have been very impressed with their support and simple to use controls. Enjoy it...

CLEAR

local sMailServer
local iMailServerPort
local sUserName
local sPassword
local oSMTP
local oMessage

sMailServer = '' && 10.0.0.4
iMailServerPort = 25
sUserName = 'test@MyDomain.com'
sPassword = 'test'

oSMTP=CREATEOBJECT("SmtpWizard.SmtpWizardCtrl")
?oSMTP.Version
oSMTP.UnlockSmtpWizard("YourSerialNumber") && Your own serial# eliminates the eval popup window
oSMTP.FailOnRecipientErrors=.t.
oSMTP.TimeOut=60000
oSMTP.UseSecurePasswordAuthentication=.t.
oSMTP.UseESMTP=.t.
oSMTP.MailServerPort=iMailServerPort
oSMTP.MailServer=sMailServer

*--- Connect
if oSMTP.Connect(sUserName,sPassword)
IF oSMTP.LoggedInWithESMTP
?'ESMTP'
endif
IF oSMTP.LoginWasSecure
?'Login was secure'
ELSE
?'Unsecure login'
endif

oMessage = CREATEOBJECT("SmtpWizard.SMTPMessage")
oMessage.fieldFROM = ["My Display Name" ]
oMessage.AddTORecipient ("User1","User1@User1Domain.com")
oMessage.AddTORecipient ("User2","User2@User2Domain.com")
oMessage.AddCCRecipient ("User3","User3@User3Domain.com")
oMessage.AddBCCRecipient("User4","User4@User4Domain.com")
oMessage.fieldSubject = [This is a sample email with SMTP Wizard]
oMessage.MessageBody = [This is the body of the message. Isn't this easy]
oMessage.AddAttachmentByFileName("C:\Config.sys")

*-- sending message
If oSMTP.SendMessage(oMessage, 1)
?'Message sent successfully'
Else
?'Error: '+oSMTP.LastErrorDescription
ENDIF

oSMTP.Disconnect
else
?oSMTP.LastErrorDescription
endif
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform