Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Email streaming
Message
General information
Forum:
Visual FoxPro
Category:
Internet applications
Title:
Miscellaneous
Thread ID:
00745612
Message ID:
00746330
Views:
14
You will need bypass Outlook and directly talk to a SMTP server. In foxpro this is not easily done without a third party component.
Since other people are plugging their solutions I might as well interject on my companies behalf.
Seekford Solutions, Inc. also offers a control that handles SMTP and more @ http://www.seekfordsolutions.com and is used by many large corporations.
Here is sample code that works with FoxPro to send emails.
----------------------------------------------
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

----------------------------------------------

Hope this helps!
Brian Seekford
Seekford Solutions, Inc.
http://www.SeekfordSolutions.com
Internet ActiveX Controls and .NET Class Libraries.
SMTP/S FTP POP3/S HTTP/S SNTP MIME PING WHOIS TRACEROUTE NNTP DNS MX
Base64, UUEncode, yEnc, MD5, SHA1, URL, Quoted-Printable.
Resizer and Tooltips
Email Verification and more. Check us out!
Previous
Reply
Map
View

Click here to load this message in the networking platform