Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Catalyst and FoxPro
Message
De
04/02/1999 09:37:07
 
 
À
03/02/1999 17:56:15
Information générale
Forum:
Visual FoxPro
Catégorie:
Produits tierce partie
Divers
Thread ID:
00183669
Message ID:
00183844
Vues:
21
>Has anyone used Catalyst 2.12 Socket Tools with VFP 5.0? I'm having some difficulty getting the mail controls to work. The mail control never throws any errors, but it also never connects. If anyone's got any experience, or has an idea of somewhere to look, it would help a lot.
>
>Thanks in advance.

Richard,

I use Catalyst controls version 1.0. I mainly using FTP and Winsock but had used the SMTP without problem. I basically used their VB example converted to VFP and I had no problems.

* Connect to SMTP server
this.cCompleted="no"
this.txtStatus.value = "Connecting..."


with this.MailControl
.Blocking = .f.
.HostName = this.txtSMTPServer.value
.RemoteService = "smtp"
.Action=1
endwith

* Identify ourselves to the server
this.txtStatus.value = "Address..."

this.MailControl.Address = this.txtFrom.value
this.MailControl.AddressMail()

* Send recipient addresses to the server
this.MailControl.Recipient = this.txtSendto.value

* Send header info to the server
dMsgDate = this.MailControl.DateStamp
cHeaderInfo1 = "From: " + alltrim(this.txtfrom.value) &&+ chr(13)+chr(10)
cHeaderInfo2 = "To: " + this.txtSendto.value + chr(13)+chr(10)
cHeaderInfo3 = "Date: " + dMsgDate + chr(13)+chr(10)
cHeaderInfo4 = "Subject: " + this.txtSubject.value + chr(13)+chr(10)
cHeaderInfo=""
cHeaderInfo =cHeaderInfo + "From: " + this.txtfrom.value + chr(13)
cHeaderInfo =cHeaderInfo + "To: " + this.txtSendto.value + chr(13)
cHeaderInfo =cHeaderInfo + "Date: " + dMsgDate + chr(13)
cHeaderInfo =cHeaderInfo + "Subject: " + this.txtSubject.value + chr(13)
cHeaderInfo5=chr(13)+chr(10)

this.txtStatus.value = "Sending Header"

For i = 1 To 5
cSendData=eval('cHeaderInfo'+ltrim(str(i)) )
this.MailControl.SendLen = Len(cSendData)
this.MailControl.SendData = cSendData
Next i

* Send the body of the message to the server
this.txtStatus.value = "Message..."

this.MailControl.SendLen = Len(alltrim(this.edtMessage.value))
this.MailControl.SendData = alltrim(this.edtMessage.value)

* Notify SMTP server to deliver message
this.MailControl.SendMail()
* Disconnect from SMTP server

this.txtStatus.value = "Disconnecting..."
this.MailControl.action=2
this.txtStatus.value = "Completed ..."
this.cCompleted="yes"
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform