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

    errore strano invio email

    Ragazzi questo è lo script scemo per mandare le mail da aspx!
    codice:
    	
    string to = Request.Form["to"];
    string oggetto = Request.Form["object"];
    string testo = Request.Form["testo"];
    	
    MailMessage mail = new MailMessage();
    mail.From = "info@vicedominiavvocatofrancesco.it";
    mail.To = to;
    mail.Subject = oggetto;
    mail.Body = testo;
    mail.BodyFormat = MailFormat.Text;
    SmtpMail.Send(mail);
    questo è nel file web.config
    codice:
    <system.net>
        <mailSettings>
          <smtp from="***@***.it">
            <network host="smtp.***.it" userName="***" password="***" port="25"/>
          </smtp>
        </mailSettings>
      </system.net>
    e questo è l'errore:
    codice:
     At least one recipient is required, but none were found.
    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: At least one recipient is required, but none were found.
    
    
    Source Error:
    
    Line 17: 	mail.Body = testo;
    Line 18: 	mail.BodyFormat = MailFormat.Text;
    Line 19: 	SmtpMail.Send(mail);
    Line 20: 	Response.Redirect ("esitoInvioEmail.asp");
    Line 21:
    che cosa è successo?
    la vita è un fulmine ma prenderlo nel culo è un lampo.

  2. #2
    Ok ho risolto!
    era un problema nel file web.config

    avevo sbagliato a mettere userName!

    Grazie cmq

    Ciao
    la vita è un fulmine ma prenderlo nel culo è un lampo.

  3. #3
    Utente di HTML.it L'avatar di nicki
    Registrato dal
    Dec 2000
    Messaggi
    139
    Ciao, probabilmente dopo l'istruzione:

    codice:
    string to = Request.Form["to"];
    "to" rimane stringa vuota.
    Ciao, nic.

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.