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

    Problema mail con ASP.NET

    Salve,
    ho creato sul sito "www.yamateam.it" la pagina MailYama.aspx.
    Ho messo tutto, conpreso la cartella BIN nella ROOT e configurato il web.config.
    Appena provo a inviare la mail mi da il seguente errore:

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

    The transport failed to connect to the server.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Runtime.InteropServices.COMException: The transport failed to connect to the server.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:


    [COMException (0x80040213): The transport failed to connect to the server.
    ]

    [TargetInvocationException: Exception has been thrown by the target of an invocation.]
    System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters) +0
    System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters) +473
    System.Web.Mail.LateBoundAccessHelper.CallMethod(O bject obj, String methodName, Object[] args) +58

    [HttpException (0x80004005): Could not access 'CDO.Message' object.]
    System.Web.Mail.LateBoundAccessHelper.CallMethod(O bject obj, String methodName, Object[] args) +113
    System.Web.Mail.CdoSysHelper.Send(MailMessage message) +1857
    System.Web.Mail.SmtpMail.Send(MailMessage message) +153
    MailYama.WebForm1.btnInvia_Click(Object sender, EventArgs e) in C:\Inetpub\wwwroot\MailYama\mailYama.aspx.vb:78
    System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
    System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String eventArgument) +57
    System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument) +18
    System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33
    System.Web.UI.Page.ProcessRequestMain() +1292




    --------------------------------------------------------------------------------
    Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET Version:1.1.4322.2032

    Il fatto è che il locale funziona PERFETTAMENTE!!
    Sapete aiutarmi??
    Grazie
    spider81man

  2. #2
    Scusate non ho postato il code behind della pagina :P
    ECCOLO:

    ----------------------------------------------------------------
    Imports System.web.Mail
    Public Class WebForm1
    Inherits System.Web.UI.Page


    #Region " Web Form Designer Generated Code "

    'This call is required by the Web Form Designer.
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

    End Sub
    Protected WithEvents txtNome As System.Web.UI.WebControls.TextBox
    Protected WithEvents txtCognome As System.Web.UI.WebControls.TextBox
    Protected WithEvents CheckBox1 As System.Web.UI.WebControls.CheckBox
    Protected WithEvents txtMessaggio As System.Web.UI.HtmlControls.HtmlTextArea
    Protected WithEvents Form1 As System.Web.UI.HtmlControls.HtmlForm
    Protected WithEvents CheckWeb As System.Web.UI.WebControls.CheckBox
    Protected WithEvents CheckYama As System.Web.UI.WebControls.CheckBox
    Protected WithEvents txtMail As System.Web.UI.WebControls.TextBox
    Protected WithEvents btnInvia As System.Web.UI.WebControls.Button
    Protected WithEvents MailTable As System.Web.UI.HtmlControls.HtmlTable
    Protected WithEvents Label1 As System.Web.UI.WebControls.Label
    Protected WithEvents Label2 As System.Web.UI.WebControls.Label

    'NOTE: The following placeholder declaration is required by the Web Form Designer.
    'Do not delete or move it.
    Private designerPlaceholderDeclaration As System.Object

    Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
    'CODEGEN: This method call is required by the Web Form Designer
    'Do not modify it using the code editor.
    InitializeComponent()
    End Sub

    #End Region

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    'Put user code to initialize the page here
    Label1.Visible = False
    Label2.Visible = False
    End Sub

    Private Sub btnInvia_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnInvia.Click
    If txtMail.Text = "" Then
    Label1.Visible = True
    Label2.Visible = True
    Label1.Text = "Campo Obbligatorio"
    Label2.Text = "Messaggio non inviato"
    Else

    Dim mailObj As New MailMessage

    'Setto i vari parametri
    mailObj.From = txtMail.Text

    If (CheckWeb.Checked) & (CheckYama.Checked) Then
    mailObj.To = "francesco.furiati@fastwebnet.it;paolo.yama@tin.it "
    ElseIf (CheckWeb.Checked) Then
    mailObj.To = "xxxx@fastwebnet.it"
    ElseIf (CheckYama.Checked) Then
    mailObj.To = "yyy@tin.it"
    End If

    mailObj.Subject = "Mail da www.yamamteam.it"

    mailObj.Body = mailObj.Body & "Nome:" & txtNome.Text & vbNewLine
    mailObj.Body = mailObj.Body & "Cognome:" & txtCognome.Text & vbNewLine
    mailObj.Body = mailObj.Body & "Domanda:" & txtMessaggio.InnerText

    mailObj.BodyFormat = MailFormat.Text

    SmtpMail.SmtpServer = "smtp.aruba.it"

    'Invio la mail

    SmtpMail.Send(mailObj)
    Label2.Visible = True
    Label2.Text = "Messaggio inviato"
    End If
    End Sub
    End Class
    ----------------------------------------------------------------
    Il provider è ARUBA

  3. #3
    Dai un'occhiata qui:


    http://vademecum.aruba.it/start/cont...tto.htm#cdosys



    Ciao
    Kalman


    PS: non lavoro per Aruba
    Kalman

  4. #4
    Il fatto è che volevo utilizzare ASP.NET

  5. #5
    OOOPSSS!! Non ci avevo fatto caso!!

    Prova così:
    codice:
        Dim m As New Mail.MailMessage
    
            Dim s As SmtpMail
    
            m.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "0") 'anonymous
            m.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", "25") 'la porta del server smtp
    
            s.SmtpServer = "smtp.aruba.it"
            s.Send(m)

    Fammi sapere
    Ciao
    Kalman
    Kalman

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.