MAIS E UM ENDERECO DE EMAIL USANDO WINSOCK TEM COM

WEBMASTER 06/01/2010 12:04:57
#331173
Eu li esse documento aqui:
http://www.faqs.org/rfcs/rfc821.html

Ajudou bastante a entender.
Das duas uma, ou voce manda com copia numa cacetada so, ou faz um QUIT para cada destino
Citação:


Send vbLf
[ô]close connection
Send [Ô]quit[Ô]

PASCOAL 06/01/2010 13:16:42
#331178
Como mandar de uma vez só??
WEBMASTER 07/01/2010 09:47:34
#331279
com varios rcpt to.
o proprio padrao RFC explica isso, a cada rcpt to voce cria uma lista...

Exemplo:

Citação:


S: MAIL FROM:<Smith@Alpha.ARPA>
R: 250 OK

S: RCPT TO:<Jones@Beta.ARPA>
R: 250 OK

S: RCPT TO:<Brown@Beta.ARPA>
R: 250 OK



Read more: http://www.faqs.org/rfcs/rfc821.html#ixzz0bvUJgJYM
PASCOAL 07/01/2010 11:18:15
#331297
OLHA A ROTINA TODA :

Dim rc As String
rcvbuf = [Ô][Ô]
sckMail.Connect txtServer, 25
Do
Sleep 10
DoEvents
Loop Until sckMail.State = sckConnected Or sckMail.State = sckError [ô]Or sckMail.State = 0
[ô]If sckMail.State = sckError Or sckMail.State = Closed Then GoTo Closed

SendWait rc, [Ô]HELO torget.se[Ô], [Ô]250[Ô] [ô]Send wich domain we are from
If rc <> [Ô]00[Ô] Then MsgBox [Ô]SendMail failed.[Ô]: GoTo Closed

SendWait rc, [Ô]MAIL FROM:[Ô] & txtFrom, [Ô]250[Ô]
If rc <> [Ô]00[Ô] Then MsgBox [Ô]Wrong FROM adress[Ô]: GoTo Closed

[ô]send from adress
SendWait rc, [Ô]RCPT TO:[Ô] & txtTo, [Ô]250[Ô]
If rc <> [Ô]00[Ô] Then MsgBox [Ô]Wrong TO adress[Ô]: GoTo Closed

[ô]start message[Ô]
SendWait rc, [Ô]DATA[Ô], [Ô]354[Ô]
If rc <> [Ô]00[Ô] Then MsgBox [Ô]SendMail failed[Ô]: GoTo Closed

[ô]send header
[ô]Send [Ô]Date: [Ô] & Format(Now, [Ô]Long Date[Ô])
Send [Ô]To: [Ô] & txtTo
Send [Ô]Subject: [Ô] & txtSubject
Send [Ô]From: [Ô] & txtFrom
[ô]if we shoudl include a file, send what delimiter we should yse
If filename <> [Ô][Ô] Then
Send [Ô]Mime-Version: 1.0[Ô]
Send [Ô]Mime-Version: 1.0[Ô]
Send [Ô]Content-Type: multipart/mixed; boundary=[Ô][Ô]=====================_312475==_[Ô][Ô][Ô]
sckMail.SendData vbCrLf

Send [Ô]Content-Type: multipart/mixed; boundary=[Ô][Ô]=====================_312475==_[Ô][Ô][Ô]
sckMail.SendData vbCrLf
End If
Send [Ô][Ô]
If filename <> [Ô][Ô] Then
Send1 [Ô]--=====================_312475==_[Ô]
Send1 [Ô]Content-Type: text/plain; charset=[Ô][Ô]us-ascii[Ô][Ô][Ô]
Send [Ô][Ô]
End If
[ô]send mail
Send txtMsg
[ô]attachment
If filename <> [Ô][Ô] Then
[ô]Send1 [Ô]An attach[Ô]
Send1 [Ô]--=====================_312475==_[Ô]
SendTextFile filename
Send1 [Ô]--=====================_312475==_[Ô]
Send1 [Ô]Content-Type: text/plain; charset=[Ô][Ô]us-ascii[Ô][Ô][Ô]
Send [Ô][Ô]
End If

[ô]end message
Send vbLf
SendWait rc, [Ô].[Ô], [Ô]250[Ô]
[ô] Next
[ô]close connection
Send [Ô]quit[Ô]
MsgBox [Ô]Email enviado com sucesso[Ô]
PASCOAL 14/01/2010 13:08:14
#331875
TENTEI FAZER ASSIM MAS NÃO ENVIOU ALGUEM PODE ME AJUDAR?

Dim rc As String
Dim A%

rcvbuf = [Ô][Ô]
sckMail.Connect txtServer, 25
Do
Sleep 10
DoEvents
Loop Until sckMail.State = sckConnected Or sckMail.State = sckError [ô]Or sckMail.State = 0
[ô]If sckMail.State = sckError Or sckMail.State = Closed Then GoTo Closed

SendWait rc, [Ô]HELO torget.se[Ô], [Ô]250[Ô] [ô]Send wich domain we are from
If rc <> [Ô]00[Ô] Then MsgBox [Ô]Email falhou....[Ô]: GoTo Closed

SendWait rc, [Ô]MAIL FROM:[Ô] & txtFrom.Text, [Ô]250[Ô]
If rc <> [Ô]00[Ô] Then MsgBox [Ô]Wrong FROM adress[Ô]: GoTo Closed

SendWait rc, [Ô]RCPT TO:[Ô] & txtTo.Text, [Ô]250[Ô]
If rc <> [Ô]00[Ô] Then MsgBox [Ô]Wrong TO adress[Ô]: GoTo Closed

[ô]start message[Ô]
SendWait rc, [Ô]DATA[Ô], [Ô]354[Ô]
If rc <> [Ô]00[Ô] Then MsgBox [Ô]SendMail failed[Ô]: GoTo Closed

[ô]send header
[ô]Send [Ô]Date: [Ô] & Format(Now, [Ô]Long Date[Ô])
Send [Ô]To: [Ô] & txtTo.Text
Send [Ô]Subject: [Ô] & txtSubject
Send [Ô]From: [Ô] & txtFrom
[ô]if we shoudl include a file, send what delimiter we should yse
If filename <> [Ô][Ô] Then
Send [Ô]Mime-Version: 1.0[Ô]
Send [Ô]Mime-Version: 1.0[Ô]
Send [Ô]Content-Type: multipart/mixed; boundary=[Ô][Ô]=====================_312475==_[Ô][Ô][Ô]
sckMail.SendData vbCrLf

Send [Ô]Content-Type: multipart/mixed; boundary=[Ô][Ô]=====================_312475==_[Ô][Ô][Ô]
sckMail.SendData vbCrLf
End If
Send [Ô][Ô]
If filename <> [Ô][Ô] Then
Send1 [Ô]--=====================_312475==_[Ô]
Send1 [Ô]Content-Type: text/plain; charset=[Ô][Ô]us-ascii[Ô][Ô][Ô]
Send [Ô][Ô]
End If
[ô]send mail
Send txtMsg
[ô]attachment
If filename <> [Ô][Ô] Then
[ô]Send1 [Ô]An attach[Ô]
Send1 [Ô]--=====================_312475==_[Ô]
SendTextFile filename
Send1 [Ô]--=====================_312475==_[Ô]
Send1 [Ô]Content-Type: text/plain; charset=[Ô][Ô]us-ascii[Ô][Ô][Ô]
Send [Ô][Ô]
End If

[ô]end message
Send vbLf
SendWait rc, [Ô].[Ô], [Ô]250[Ô]
[ô]Next
[ô]Close
Send [Ô]quit[Ô]
sckMail.Close
DoEvents
For i = 1 To 5000: Next i


[ô]=========================================AQUI é O SEGUNDO EMAIL

rcvbuf = [Ô][Ô]
sckMail.Connect txtServer, 25
Do
Sleep 10
DoEvents
Loop Until sckMail.State = sckConnected Or sckMail.State = sckError [ô]Or sckMail.State = 0
[ô]If sckMail.State = sckError Or sckMail.State = Closed Then GoTo Closed

SendWait rc, [Ô]HELO torget.se[Ô], [Ô]250[Ô] [ô]Send wich domain we are from
If rc <> [Ô]00[Ô] Then MsgBox [Ô]Email falhou....[Ô]: GoTo Closed

SendWait rc, [Ô]MAIL FROM:[Ô] & txtFrom.Text, [Ô]250[Ô]
If rc <> [Ô]00[Ô] Then MsgBox [Ô]Wrong FROM adress[Ô]: GoTo Closed

SendWait rc, [Ô]RCPT TO:[Ô] & txtTo2.Text, [Ô]250[Ô]
If rc <> [Ô]00[Ô] Then MsgBox [Ô]Wrong TO adress[Ô]: GoTo Closed

SendWait rc, [Ô]DATA[Ô], [Ô]354[Ô]
If rc <> [Ô]00[Ô] Then MsgBox [Ô]SendMail failed[Ô]: GoTo Closed

Send [Ô]To: [Ô] & txtTo2.Text
Send [Ô]Subject: [Ô] & txtSubject
Send [Ô]From: [Ô] & txtFrom
[ô]if we shoudl include a file, send what delimiter we should yse
If filename <> [Ô][Ô] Then
Send [Ô]Mime-Version: 1.0[Ô]
Send [Ô]Mime-Version: 1.0[Ô]
Send [Ô]Content-Type: multipart/mixed; boundary=[Ô][Ô]=====================_312475==_[Ô][Ô][Ô]
sckMail.SendData vbCrLf

Send [Ô]Content-Type: multipart/mixed; boundary=[Ô][Ô]=====================_312475==_[Ô][Ô][Ô]
sckMail.SendData vbCrLf
End If
Send [Ô][Ô]
If filename <> [Ô][Ô] Then
Send1 [Ô]--=====================_312475==_[Ô]
Send1 [Ô]Content-Type: text/plain; charset=[Ô][Ô]us-ascii[Ô][Ô][Ô]
Send [Ô][Ô]
End If
[ô]send mail
Send txtMsg
[ô]attachment
If filename <> [Ô][Ô] Then
[ô]Send1 [Ô]An attach[Ô]
Send1 [Ô]--=====================_312475==_[Ô]
SendTextFile filename
Send1 [Ô]--=====================_312475==_[Ô]
Send1 [Ô]Content-Type: text/plain; charset=[Ô][Ô]us-ascii[Ô][Ô][Ô]
Send [Ô][Ô]
End If

[ô]end message
Send vbLf
SendWait rc, [Ô].[Ô], [Ô]250[Ô]
Send [Ô]quit[Ô]
sckMail.Close
DoEvents
For i = 1 To 5000: Next i
[ô]=========================================AQUI é O TERCEIRO EMAIL

rcvbuf = [Ô][Ô]
sckMail.Connect txtServer, 25
Do
Sleep 10
DoEvents
Loop Until sckMail.State = sckConnected Or sckMail.State = sckError [ô]Or sckMail.State = 0
[ô]If sckMail.State = sckError Or sckMail.State = Closed Then GoTo Closed

SendWait rc, [Ô]HELO torget.se[Ô], [Ô]250[Ô] [ô]Send wich domain we are from
If rc <> [Ô]00[Ô] Then MsgBox [Ô]Email falhou....[Ô]: GoTo Closed
SendWait rc, [Ô]MAIL FROM:[Ô] & txtFrom.Text, [Ô]250[Ô]
If rc <> [Ô]00[Ô] Then MsgBox [Ô]Wrong FROM adress[Ô]: GoTo Closed

SendWait rc, [Ô]RCPT TO:[Ô] & txtTo3.Text, [Ô]250[Ô]
If rc <> [Ô]00[Ô] Then MsgBox [Ô]Wrong TO adress[Ô]: GoTo Closed

SendWait rc, [Ô]DATA[Ô], [Ô]354[Ô]
If rc <> [Ô]00[Ô] Then MsgBox [Ô]SendMail failed[Ô]: GoTo Closed

Send [Ô]To: [Ô] & txtTo3.Text
Send [Ô]Subject: [Ô] & txtSubject
Send [Ô]From: [Ô] & txtFrom
If filename <> [Ô][Ô] Then
Send [Ô]Mime-Version: 1.0[Ô]
Send [Ô]Mime-Version: 1.0[Ô]
Send [Ô]Content-Type: multipart/mixed; boundary=[Ô][Ô]=====================_312475==_[Ô][Ô][Ô]
sckMail.SendData vbCrLf

Send [Ô]Content-Type: multipart/mixed; boundary=[Ô][Ô]=====================_312475==_[Ô][Ô][Ô]
sckMail.SendData vbCrLf
End If
Send [Ô][Ô]
If filename <> [Ô][Ô] Then
Send1 [Ô]--=====================_312475==_[Ô]
Send1 [Ô]Content-Type: text/plain; charset=[Ô][Ô]us-ascii[Ô][Ô][Ô]
Send [Ô][Ô]
End If
[ô]send mail
Send txtMsg
[ô]attachment
If filename <> [Ô][Ô] Then
[ô]Send1 [Ô]An attach[Ô]
Send1 [Ô]--=====================_312475==_[Ô]
SendTextFile filename
Send1 [Ô]--=====================_312475==_[Ô]
Send1 [Ô]Content-Type: text/plain; charset=[Ô][Ô]us-ascii[Ô][Ô][Ô]
Send [Ô][Ô]
End If

[ô]end message
Send vbLf
SendWait rc, [Ô].[Ô], [Ô]250[Ô]
Send [Ô]quit[Ô]
sckMail.Close
DoEvents
For i = 1 To 5000: Next i
MsgBox [Ô]Email enviado com sucesso[Ô]
DANIKULL 14/01/2010 20:54:53
#331937
PASCOAL, boa noite.

Você montou a mesma rotina três vezes para o envio do e-mail???
Isso é desnecessário, basta você fazer um loop dentro da propria rotina para enviar o mesmo e-mail para os três endereços, ou mais, que você precise, entendeu??
Tenta ai, vai funcionar
PASCOAL 14/01/2010 23:17:23
#331954
Eu ja tentei isso mas não consegui como devo proceder?

Obrigadol
Página 3 de 3 [27 registro(s)]
Tópico encerrado , respostas não são mais permitidas