Visualizzazione dei risultati da 1 a 4 su 4

Discussione: [VB.NET] invio mail

  1. #1

    [VB.NET] invio mail

    Ciao sto cercando di modificare la pagina che invia le mail dal mio sito, poichè mi hanno cambiato il server da 2000 a 2003 e adesso l' oggetto CDONTS non lo riconosce più.

    Ho usato questa pagina per prova ma mi da errore

    codice:
    <%@page language="VB" %>
    <%@Import Namespace="System.Web.Util" %>
    
    <script language="VB" runat="server">
    Sub inviaEmail(Obj As Object, E As EventArgs)
    'Creo l'oggetto MailMessage
    Dim mailObj AS new MailMessage
    
    'Setto i vari parametri
    mailObj.From = "mittente@email.com"
    mailObj.To = "destinatario@email.com"
    mailObj.Subject = "soggetto della mail"
    mailObj.Body = "testo della mail"
    
    'Formato HTML della email
    mailObj.BodyFormat = MailFormat.Html
    
    'Invio la mail
    SmtpMail.Send(mailObj)
    End Sub
    </script>

    Errore

    Riga 5: Sub inviaEmail(Obj As Object, E As EventArgs)
    Riga 6: 'Creo l'oggetto MailMessage
    Riga 7: Dim mailObj AS new MailMessage
    Riga 8:
    Riga 9: 'Setto i vari parametri

    BC30002: Tipo 'MailMessage' non definito

  2. #2
    usa cosi:
    invece di:
    <%@Import Namespace="System.Web.Util" %>
    mettici:
    <%@ import NameSpace="System.Web.Mail" %>

    fammi sapere!"

  3. #3
    mi esce sempre questo su aruba

    Server Error in '/' Application.
    --------------------------------------------------------------------------------

    Runtime Error
    Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

    Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".




    <configuration>
    <system.web>
    <customErrors mode="Off"/>
    </system.web>
    </configuration>


    Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.




    <configuration>
    <system.web>
    <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
    </system.web>
    </configuration>



    in locale funziona ne ho fatta una anche in C# e in locale funziona, in remoto no ...

  4. #4
    lo so in remoto non funge manco a me..dovro contattare il mio hosting!

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.