grazie quel problema l'ho risolto. ora ne ho un altro. per inviare l'email devo accedere a un server smtp che richiede l'autenticazione del mittente. io per fare questo ho scritto così:
codice:
private void InviaEmail()
{
SmtpClient Smtp = new SmtpClient();
Messaggio.From = new MailAddress(txtDa.Text);
Messaggio.To.Add(new MailAddress(txtA.Text));
if (txtCc.Text != "")
Messaggio.CC.Add(new MailAddress(txtCc.Text));
Messaggio.Subject = (txtOggetto.Text);
Messaggio.Body = (txtMessaggio.Text);
Smtp.Host = ("smtp.palazzomorgana.it");
Smtp.Port = 25;
CredentialCache Credenziali = new CredentialCache();
Credenziali.Add("server SMTP", 25, "Basic", new NetworkCredential("Nome utente", "Password"));
Smtp.Credentials = Credenziali;
try
{
Smtp.Send(Messaggio);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Client e-mail", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
però mi quanto tento di inviare il messaggio mi genera questa eccezione:
"Nome di cassetta postale non consentito. Risposta del server: sorry, you need to supply the correct username and password for SMTP-AUTH (#5.7.1)"
HELP!!