Eccolo quì:
Ciao.codice:Private Sub InviaMail(Oggi As Date, Destinatario As String) Dim Rimozione, ID As String ID = Oggi & Rnd(4) & "@libero.it" Rimozione = "In caso non vogliate più ricevere le nostre E-mail preghiamo richiedere la rimozione dalla mailing list, Grazie." WS.Connect Do Until WS.State = sckConnected DoEvents Loop WS.SendData ("HELO " & "mail.libero.it" & vbCrLf) RisposteServer WS.SendData ("MAIL FROM: " & "rentram@iol.it" & vbCrLf & "RCPT TO: " & Destinatario & vbCrLf) RisposteServer WS.SendData ("DATA" & vbCrLf) RisposteServer WS.SendData ("Message-ID: " & ID & vbCrLf & "Date: " & Oggi & vbCrLf) WS.SendData ("From: " & txtNome.Text & vbCrLf & txtCont.Text & vbCrLf & Rimozione & vbCrLf) WS.SendData ("Oggetto: " & txtSub.Text & vbCrLf) WS.SendData ("." & vbCrLf) RisposteServer WS.SendData ("QUIT" & vbCrLf) RisposteServer WS.Close End Sub

Rispondi quotando