Visualizzazione dei risultati da 1 a 8 su 8

Discussione: Invio NewsLetters

  1. #1
    Utente di HTML.it
    Registrato dal
    Mar 2005
    Messaggi
    34

    Invio NewsLetters

    Questa è la pagina di invio NewsLetters di un CMS che si trova su un host di Aruba con Widows 2003 :

    <%
    strSubject = Request.Form("subject")
    strMessage = Request.Form("message")
    If strSubject = "" Or strMessage = "" Then
    Response.Write "Please fill in subject and message details!"
    Else
    Set objRS = connect.Execute ("SELECT * FROM maillista")
    If objRS.EOF Then
    Response.Write "There are no current subscribers to the newsletter service"
    Else
    Do Until objRS.EOF
    Response.Write "Sent to " & objRS("email") & "
    "
    ' CDONTS
    Set objMail = Server.CreateObject("CDONTS.NewMail")
    objMail.From = tipsmail
    objMail.To = objRS("email")
    objMail.Subject = strSubject
    objMail.Body = strMessage
    objMail.Send
    Set objMail = Nothing

    Response.Flush
    objRS.MoveNext
    Loop
    Response.Write "

    Clear!"
    End If
    objRS.Close
    Set objRS = Nothing

    End If
    %>


    si può cambiare il codice invece di CDONTS usare CDOSYS ??? Grazie per le risposte....

  2. #2
    Utente di HTML.it L'avatar di wegawhite
    Registrato dal
    Aug 2004
    Messaggi
    1,400
    Solo la parte per invio CDOSYS:

    codice:
    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"
    	
    Set objConfig = Server.CreateObject("CDO.Configuration")
    Set Fields = objConfig.Fields
    
    With Fields
    	.Item(cdoSendUsingMethod)       = cdoSendUsingPort
    	.Item(cdoSMTPServer)            = "nome.tuodominio"
    	.Item(cdoSMTPServerPort)        = 25
    	.Item(cdoSMTPConnectionTimeout) = 10
    	.Update
    End With
    
    Set objMessage = Server.CreateObject("CDO.Message")
    Set objMessage.Configuration = objConfig
    
    With objMessage
            .To       = "email destinatario"
            .From    = "Email mittente"
            .Cc       = "Email copia conoscenza"
    	.BCc      = "Email copia conoscenza nascosta"
    	.Subject  = "ciao"
    	.HtmlBody = "messaggio"
    	.Send
    End With
    
    Set Fields = Nothing
    Set objMessage = Nothing
    Set objConfig = Nothing

  3. #3
    Utente di HTML.it
    Registrato dal
    Mar 2005
    Messaggi
    34

    Invio NewsLetters

    Questa parte di codice la conoscevo già, ma come faccio a configurarla con l'invio della newsletters dato che il sistema genera tanti invii di posta elettronica ( loop ) quanti sono gli iscritti alla newsletters ??? Grazie....

  4. #4
    Sostituisci questo:
    codice:
    Set objMail = Server.CreateObject("CDONTS.NewMail")
    objMail.From = tipsmail
    objMail.To = objRS("email")
    objMail.Subject = strSubject
    objMail.Body = strMessage
    objMail.Send
    Set objMail = Nothing
    Con questo
    codice:
    Set myMail = CreateObject("CDO.Message")
    myMail.Subject = strSubject
    myMail.From = tipsmail
    myMail.To = objRS("email")
    myMail.TextBody = strMessage
    myMail.Send
    
    Set myMail = Nothing

  5. #5
    Utente di HTML.it
    Registrato dal
    Mar 2005
    Messaggi
    34

    Invio NewsLetters

    Il CMS dopo un bel pò di tempo mi genera questo errore :

    Sent to beth12756@libero.it

    Active Server Pages error 'ASP 0113'

    Script timed out

    /public/cms/default.asp

    The maximum amount of time for a script to execute was exceeded. You can change this limit by specifying a new value for the property Server.ScriptTimeout or by changing the value in the IIS administration tools.

    avvisandomi che le-mail è stata inviata ma non è mai arrivata.

    Grazie per la pazienza....

  6. #6
    Utente di HTML.it
    Registrato dal
    Mar 2005
    Messaggi
    34
    Grazie Dirk Pitt tutto funziona avevo sbagliato aggiornando il file in internet

  7. #7
    Utente di HTML.it
    Registrato dal
    Mar 2005
    Messaggi
    34
    Grazie Dirk Pitt tutto funziona avevo sbagliato aggiornando il file in internet Grazie...

  8. #8

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 © 2025 vBulletin Solutions, Inc. All rights reserved.