16/05/11 12:11
The Real Dummie
amici, lo ammetto a partire dal nick: sono una chiavica :-(
mi sto cimentando con il winsock per inviare mail attingendo gli indirizzi da un database (in cui sono inseriti solo quelli e non altri dati).
purtroppo pero' mi va a singhiozzo: spedisce un po' di mail e poi si schianta :-(
qualche anima pia puo' aiutarmi?
grazie e gioai a tutti
TRD
ps il codice che uso è:
Private Sub DataREC1_Validate(Action As Integer, Save As Integer)
On Error Resume Next
sFrom$ = "xxxxxxxxxxx@gmail.com"
sTo$ = LabelEmail.Caption
sSubject$ = TextOggetto.Text
sMessage$ = TextMessaggio.Text
Winsock1.Connect "smtp.fastwebnet.it", 25
Do While Winsock1.State <> sckConnected: DoEvents: Loop
sendMsg "HELO " & "Peaches"
sendMsg "MAIL FROM: <" & sFrom & ">"
sendMsg "RCPT TO: <" & sTo & ">"
sendMsg "DATA"
M$ = M$ + "From: <" + sFrom + ">" + vbCrLf
M$ = M$ + "To: <" + sTo + ">" + vbCrLf
M$ = M$ + "Subject: " + sSubject$ + vbCrLf
M$ = M$ + "Date: " + Format$(Now, "h:mm:ss" + vbCrLf
M$ = M$ + "MIME-Version: 1.0" + vbCrLf
M$ = M$ + "Content-Type: text/plain; charset=us-ascii" + vbCrLf + vbCrLf
M$ = M$ + sMessage$ + vbCrLf + vbCrLf + "." + vbCrLf
sendMsg M$ + "QUIT"
Winsock1.Close
End Sub
mi sto cimentando con il winsock per inviare mail attingendo gli indirizzi da un database (in cui sono inseriti solo quelli e non altri dati).
purtroppo pero' mi va a singhiozzo: spedisce un po' di mail e poi si schianta :-(
qualche anima pia puo' aiutarmi?
grazie e gioai a tutti
TRD
ps il codice che uso è:
Private Sub DataREC1_Validate(Action As Integer, Save As Integer)
On Error Resume Next
sFrom$ = "xxxxxxxxxxx@gmail.com"
sTo$ = LabelEmail.Caption
sSubject$ = TextOggetto.Text
sMessage$ = TextMessaggio.Text
Winsock1.Connect "smtp.fastwebnet.it", 25
Do While Winsock1.State <> sckConnected: DoEvents: Loop
sendMsg "HELO " & "Peaches"
sendMsg "MAIL FROM: <" & sFrom & ">"
sendMsg "RCPT TO: <" & sTo & ">"
sendMsg "DATA"
M$ = M$ + "From: <" + sFrom + ">" + vbCrLf
M$ = M$ + "To: <" + sTo + ">" + vbCrLf
M$ = M$ + "Subject: " + sSubject$ + vbCrLf
M$ = M$ + "Date: " + Format$(Now, "h:mm:ss" + vbCrLf
M$ = M$ + "MIME-Version: 1.0" + vbCrLf
M$ = M$ + "Content-Type: text/plain; charset=us-ascii" + vbCrLf + vbCrLf
M$ = M$ + sMessage$ + vbCrLf + vbCrLf + "." + vbCrLf
sendMsg M$ + "QUIT"
Winsock1.Close
End Sub
aaa