Visualizzazione dei risultati da 1 a 8 su 8

Discussione: Invio form con cdo

  1. #1

    Ivio form con cdo

    Ciao a tutti,

    ho questo modulo per l'invio di un form.
    Mi succede una cosa strana: l'invio non mi da errore ma non arriva nessuna mail.
    C'è qualcuno disposto a darmi una mano? :master:


    <%

    Const cdoBasic = 1 'Use basic (clear-text) authentication.
    Const cdoSendUsingPort = 2

    Dim iMsg
    Dim iConf
    Dim Flds

    On Error Resume Next

    'Create message and configuration objects
    set iMsg = CreateObject("CDO.Message")
    set iConf = CreateObject("CDO.Configuration")

    Set Flds = iConf.Fields

    'Apply settings to the configuration object
    With Flds
    ' Specify the authentication mechanism to basic (clear-text) authentication.
    .Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdoBasic
    ' The username for authenticating to an SMTP server
    .Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "indirizzomail"
    ' The password used to authenticate to an SMTP server
    .Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "password"
    ' 1 se smtp e http sono sulla stessa macchina, 2 se sono su macchine diverse
    .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1
    'Specify mail server
    .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost"
    'Specify the timeout in seconds
    .Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10

    ' The port on which the SMTP service specified by the smtpserver field is listening for connections (typically

    25)
    .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
    'Use SSL for the connection (False or True)
    .Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False

    .Update
    End With

    Dim sMsg
    Dim sTo
    Dim sCC
    Dim sFrom
    Dim sSubject
    Dim sTextBody
    Dim msg


    msg = msg & "<table width=600 border=1 cellpadding=0 cellspacing=0 bordercolor=#999999>"
    msg = msg & "<tr><td colspan=2><H3>Dati provenienti dal modulo</H3></td></tr>"
    msg = msg & "<tr><td width=200>Ragione Sociale</td><td>" &

    request.form("Ragione_Sociale") & "</td></tr>"
    msg = msg & "<tr><td width=200>Nome e Cognome</td><td>" & request.form("Nome_Cognome") &

    "</td></tr>"
    msg = msg & "<tr><td width=200>Indirizzo</td><td>" & request.form("Indirizzo") &

    "</td></tr>"
    msg = msg & "<tr><td width=200>CAP</td><td>" & request.form("CAP") & "</td></tr>"
    msg = msg & "<tr><td width=200>Citta</td><td>" & request.form("Citta") & "</td></tr>"
    msg = msg & "<tr><td width=200>Provincia</td><td>" & request.form("Provincia") &

    "</td></tr>"
    msg = msg & "<tr><td width=200>Nazione</td><td>" & request.form("Nazione") &

    "</td></tr>"
    msg = msg & "<tr><td width=200>Telefono</td><td>" & request.form("Telefono") &

    "</td></tr>"
    msg = msg & "<tr><td width=200>Fax</td><td>" & request.form("Fax") & "</td></tr>"
    msg = msg & "<tr><td width=200>Email</td><td>" & request.form("Email") & "</td></tr>"



    msg = msg & "</table>
    "



    sTo = "indirizzomail"

    sFrom = "Contattaci"
    sSubject = "Dati modulo CONTATTACI"

    'Apply the settings to the message object
    With iMsg
    Set .Configuration = iConf
    .To = sTo
    .From = sFrom
    .Subject = sSubject
    .HtmlBody = msg

    'Send message
    .Send

    End With

    ' cleanup mail objects
    Set iMsg = Nothing
    Set iConf = Nothing
    Set Flds = Nothing


    response.redirect "tanks.asp"
    If Err.Number <> 0 Then
    response.write "error"
    End If


    %>

  2. #2
    Come smtp non devi mettere localhost, ma l'smtp di un vero server di posta.
    Se sei in locale allora metti l'smtp del tuo internet provider, per intenderci lo stesso che usi per inviare le email dal tuo client di posta (outlook, tunderbird, etc).

  3. #3
    Ti ringrazio per la risposta.
    Ho provato a togliere "localhost" e ad inserire il percorso dell'smtp ma continua a non arrivare nessuna mail.

    (Le prove le faccio dal sito web e non in locale)

    Non sarà un problema di codice asp?

  4. #4
    Cosa hai messo esattamente come server smtp?
    Domanda: con chi ti connetti ad internet?

  5. #5
    come smtp ho inserito:

    smtp.occasionecasa.net

    La mia connessione ad internet è con adsl di tiscali (smtp.tiscali.it)

    Il provider mi ha detto che il server di posta è linux invece il server che ospita il sito è windows 2003...

  6. #6
    Allora metti l'smtp di tiscali in locale.
    Poi, quando copi i file online metti quello di prima.

  7. #7
    Scusa ma non capisco cosa vuoi dire.

    Io nella pagina web "invio_dati.asp" al posto di "localhost" ho inserito "smtp.occasionecasa.net".

    Poi ho fatto l'upload del file sul server ma, se mi invio un form di richiesta di prova non mi arriva nessuna mail.

    Ho fatto la stessa procedura inserendo "smtp.tiscali.it" al posto di "smtp.occasionecasa.net" e accade la stessa cosa.
    Non so come venirne a capo....

  8. #8
    Sei su aruba?
    Metti smtp.aurba.it

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.