Home Page
Articoli
Tips & Tricks
News
Forum
Archivio Forum
Blogs
Sondaggi
Rss
Video
Utenti
Chi Siamo
Contattaci
Username:
Password:
Login
Registrati ora!
Recupera Password
Home Page
Stanze Forum
ASP.NET 2.0 / 3.5 / 4.0
Invio mail con asp.net 2.0
giovedì 14 settembre 2006 - 12.01
Elenco Threads
Stanze Forum
Aggiungi ai Preferiti
Cerca nel forum
sorbino
Profilo
| Newbie
30
messaggi | Data Invio:
gio 14 set 2006 - 12:01
Salve ragazzi ho un problemino per l'invio mail, per ora voglio vedere solo se le mail vengono inviate ed ho scritto il seguente codice:
protected void Button1_Click(object sender, EventArgs e)
{
MailMessage messaggio = new MailMessage();
messaggio.From = new MailAddress("indirizzomailmittente@mittente.it", "Davide");
messaggio.To.Add(new MailAddress("sorbinoweb@host.it"));
messaggio.Subject="Prova";
messaggio.Body="prova mail chissà se funge";
try
{
SmtpClient invio = new SmtpClient("smtp.host.it,25");
invio.Send(messaggio);
}
catch (Exception ex) {
Response.Write("Errore: " + ex);
}
}
mi esce il seguente errore:
Errore: System.Net.Mail.SmtpException: Failure sending mail. ---> System.Net.WebException: The remote name could not be resolved: 'smtp.host.it,25' at System.Net.ServicePoint.GetConnection(PooledStream PooledStream, Object owner, Boolean async, IPAddress& address, Socket& abortSocket, Socket& abortSocket6, Int32 timeout) at System.Net.PooledStream.Activate(Object owningObject, Boolean async, Int32 timeout, GeneralAsyncDelegate asyncCallback) at System.Net.PooledStream.Activate(Object owningObject, GeneralAsyncDelegate asyncCallback) at System.Net.ConnectionPool.GetConnection(Object owningObject, GeneralAsyncDelegate asyncCallback, Int32 creationTimeout) at System.Net.Mail.SmtpConnection.GetConnection(String host, Int32 port) at System.Net.Mail.SmtpTransport.GetConnection(String host, Int32 port) at System.Net.Mail.SmtpClient.GetConnection() at System.Net.Mail.SmtpClient.Send(MailMessage message) --- End of inner exception stack trace --- at System.Net.Mail.SmtpClient.Send(MailMessage message) at _Default.Button1_Click(Object sender, EventArgs e)
come host metto quello che ho aquistato su aruba.
___________________________________________________________________________________
ok funziona ho fatto io na cacchiata per distrazione
SmtpClient invio = new SmtpClient("smtp.host.it,25");
devo fare SmtpClient invio = new SmtpClient("smtp.host.it",25);
sorbino
Profilo
| Newbie
30
messaggi | Data Invio:
gio 14 set 2006 - 21:26
che può accadere se metto anche la porta????
Torna su
Stanze Forum
Elenco Threads
Partecipa anche tu! Registrati!
Hai bisogno di aiuto ?
Perchè non ti registri subito?
Dopo esserti registrato potrai chiedere
aiuto sul nostro
Forum
oppure aiutare gli altri
Consulta le
Stanze
disponibili.
Registrati ora !