Originariamente inviato da iperuber
il problema forse è che sto all'università e che sto in rete locale e non conosco indirizzo del server smtp.
Un codice scritto in questo modo dovrebbe funzionare?
using System.Web.Mail;
...
private void Page_Load(object sender, System.EventArgs e)
{
MailMessage mail = new MailMessage();
mail.From = "mittente@ingegneria.unile.it";
mail.To = "destinatario@ingegneria.unile.it";
mail.Subject ="fammi sapere se arriva";
mail.Body = "ciao marco";
SmtpMail.Send( mail );
}
Il file di log mi dice:
2005-01-28 11:14:11 - OutboundConnectionResponse - 0 - 0 - -
2005-01-28 11:14:11 cabis.unile.it OutboundConnectionCommand - 0 EHLO 0 - -
2005-01-28 11:14:11 cabis.unile.it OutboundConnectionResponse - 0 - 0 - -
2005-01-28 11:14:28 - OutboundConnectionResponse - 0 - 0 - -
2005-01-28 11:14:28 mc11-f8.hotmail.com OutboundConnectionCommand - 0 EHLO 0 - -
2005-01-28 11:14:28 mc11-f8.hotmail.com OutboundConnectionResponse - 0 - 0 - -
2005-01-28 11:14:28 - OutboundConnectionResponse - 0 - 0 - -
2005-01-28 11:14:28 mc3-f29.hotmail.com OutboundConnectionCommand - 0 EHLO 0 - -
2005-01-28 11:14:30 mc3-f29.hotmail.com OutboundConnectionResponse - 0 - 0 - -
2005-01-28 11:14:52 - OutboundConnectionResponse - 0 - 0 - -
2005-01-28 11:14:52 mc7-f9.hotmail.com OutboundConnectionCommand - 0 EHLO 0 - -
2005-01-28 11:14:52 mc7-f9.hotmail.com OutboundConnectionResponse - 0 - 0 - -
Ne ho un sacco di questi messaggi, che diavolo devo fare?