You can go to
http://www.SeekfordSolutions.com and get the SMTP Wizard ActiveX control which lets you send emails directly. This means you don't need to use or rely on Outlook.
Here is the sample code
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
Enjoy.
Brian Seekford
Seekford Solutions, Inc.http://www.SeekfordSolutions.comInternet 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!