Visualizzazione dei risultati da 1 a 2 su 2
  1. #1

    Email doppie a destinatari lista

    Ciao.

    Qualcuno può aiutarmi a capire se questo script invia email doppie, cioè la stessa email uguale per ciascun destinatario della lista ?

    Non posso provarlo al momento... grazie...

    codice:
       Conta = 0
       ListaDestinatari = ""
       Blocco = 0
          
       Do Until rec.eof
       Do Until (Conta > 9) OR (rec.eof = true)
    
       ListaDestinatari = ListaDestinatari & rec("email") & "; "
       Conta = Conta + 1
       Blocco = Blocco + 1
       
       rec.MoveNext() 
       Loop   
    
    '#### CREO LA MAIL
    	
    Set objConfig = Server.CreateObject("CDO.Configuration")
    Set Fields = objConfig.Fields
    
    With Fields
    	.Item(cdoSendUsingMethod)       = cdoSendUsingPort
    	.Item(cdoSMTPServer)            = "XXXXX"
    	.Item(cdoSMTPServerPort)        = 25
    	.Item(cdoSMTPConnectionTimeout) = 60
    	.Update
    End With
    
    Set objMessage = Server.CreateObject("CDO.Message")
    Set objMessage.Configuration = objConfig
    
    If objMessage Is Nothing Then
      Response.Write "Failed to create object 
    "
    Else
      Response.Write "objMessage created OK 
    "
    End If
    
    With objMessage
        .From     = "emailmittente@email.it"
        .To       = ListaDestinatari
        .Subject  = strOggetto
        .HtmlBody = messaggio
        .Fields("urn:schemas:httpmail:importance").Value = 2 
        .Fields("urn:schemas:mailheader:X-MSMail-Priority") = 6
        .Fields.Update()	
    
    on error resume next
       objMessage.Send
       if Err.Number <> 0 then
         response.Write "Email send failed # : " & Err.Number & " -  " & Err.Description & ".
    "&vbcrlf
       end if	
    End With
    
       Set Fields = Nothing
       Set objMessage = Nothing
    
    Response.Write("Trasmesso a numero = " & blocco & " destinatari ===> Attendo 2 secondi...")
    Response.Flush
    Sleep 2
    Response.Write("OK ===> ")
    
    response.write "Email inviata a ===> " 
    response.write "" & ListaDestinatari & ""
    response.write "
    
    "
    
    Conta = 0
    ListaDestinatari = ""
          
       Loop 
    
       Set objConfig = Nothing

  2. #2
    Scusate avevo il server out, adesso ho provato lo script ed in effetti a 10 destinatari invia 1 email ciascuna ma ad un destinatario ( sempre lo stesso ) la invia doppia... dove può essere il problema?

    codice:
    
    
    <%
    
       Server.ScriptTimeout = 10000
       
       response.buffer = true
       response.expires = -1500 
       response.AddHeader "PRAGMA", "NO-CACHE"
       response.CacheControl = "PRIVATE"    
       
       Function Sleep(sec)
    	   Dim Start:Start = Timer:While (Timer-Start<sec):Wend
       End function   
       
       sDatabaseConnection = "DRIVER={MySQL ODBC 3.51 Driver};"_
                           & "SERVER=localhost;"_
                           & "DATABASE=test;"_
                           & "UID=root;PWD=xyyyyyyy; OPTION=35;"
    
       Set cn = Server.Createobject("ADODB.Connection")
       cn.open sDatabaseConnection   
    
    '***********************
       
    Const cdoSendUsingMethod        = _
    	"http://schemas.microsoft.com/cdo/configuration/sendusing"
    Const cdoSendUsingPort          = 2
    Const cdoSMTPServer             = _
    	"http://schemas.microsoft.com/cdo/configuration/smtpserver"
    Const cdoSMTPServerPort         = _
    	"http://schemas.microsoft.com/cdo/configuration/smtpserverport"
    Const cdoSMTPConnectionTimeout  = _
    	"http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout"
     
       SQL = " SELECT * FROM "
       SQL = SQL & " tbl "
       SQL = SQL & " ORDER BY "
       SQL = SQL & " Email ASC "
       
       Set rec = server.CreateObject("ADODB.Recordset") 
       rec.Open SQL, Cn
    
       if not rec.eof then    
    
    %>
    
    
    
    <%
    
       rec.MoveFirst()   
       Conta = 0
       ListaDestinatari = ""
       Blocco = 0
          
       Do Until rec.eof
       Do Until (Conta > 0) OR (rec.eof = true)
    
       ListaDestinatari = ListaDestinatari & rec("email") & "; "
       Conta = Conta + 1
       Blocco = Blocco + 1
       
       rec.MoveNext() 
       Loop   
    
    '#### CREO LA MAIL
    	
    Set objConfig = Server.CreateObject("CDO.Configuration")
    Set Fields = objConfig.Fields
    
    With Fields
    	.Item(cdoSendUsingMethod)       = cdoSendUsingPort
    	.Item(cdoSMTPServer)            = "xxxxxx"
    	.Item(cdoSMTPServerPort)        = 25
    	.Item(cdoSMTPConnectionTimeout) = 60
    	.Update
    End With
    
    Set objMessage = Server.CreateObject("CDO.Message")
    Set objMessage.Configuration = objConfig
    
    If objMessage Is Nothing Then
      Response.Write "Failed to create object 
    "
    Else
      Response.Write "objMessage created OK 
    "
    End If
    
    With objMessage
        .From     = "email@email.it"
        .To       = ListaDestinatari
        .Subject  = strOggetto
        .HtmlBody = messaggio
        .Fields("urn:schemas:httpmail:importance").Value = 2 
        .Fields("urn:schemas:mailheader:X-MSMail-Priority") = 6
        .Fields.Update()	
    
    on error resume next
       objMessage.Send
       if Err.Number <> 0 then
         response.Write "Email send failed # : " & Err.Number & " -  " & Err.Description & ".
    "&vbcrlf
       end if	
    End With
    
       Set Fields = Nothing
       Set objMessage = Nothing
    
    Response.Write("Trasmesso a numero = " & blocco & " destinatari ===> Attendo 2 secondi...")
    Response.Flush
    Sleep 2
    Response.Write("OK ===> ")
    
    response.write "Email inviata a ===> " 
    response.write "" & ListaDestinatari & ""
    response.write "
    
    "
    
    Conta = 0
    ListaDestinatari = ""
          
       Loop 
    
       Set objConfig = Nothing    
        
       end if   
       
       rs.Close()
       Set rs = Nothing
       
       rec.Close()
       Set rec = Nothing
    
       cn.Close()
       Set cn = Nothing
    
    %>

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.