asp .net send mail
-
hi all, I'm trying to send mail using asp.net and smtp server set up on the same machine, this machine belongs to a domain, I follow the code described in article below http://www.developer.com/net/asp/article.php/3096831 I didn't get any exceptions, but when I check the recipient mail I keyed in, there is no messages sent. I wonder whether it's asp.net unable to send mail or something wrong with smtp server. Help please...
-
hi all, I'm trying to send mail using asp.net and smtp server set up on the same machine, this machine belongs to a domain, I follow the code described in article below http://www.developer.com/net/asp/article.php/3096831 I didn't get any exceptions, but when I check the recipient mail I keyed in, there is no messages sent. I wonder whether it's asp.net unable to send mail or something wrong with smtp server. Help please...
using System.Web.Mail; /*****************************************************************/ MailMessage mail = new MailMessage(); mail.To = "Your Email Address"; mail.From ="hellin_zhang@hotmail.com"; mail.Subject = "hello, buddy" mail.Body = "Some text goes here"; mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1"); //basic authentication mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "hellin_zhang"); //set your username here mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "123456"); //set your password here SmtpMail.SmtpServer = "smtp.hotmail.com.com"; try{ SmtpMail.Send( mail ); }catch(Exception ex){ }
-
using System.Web.Mail; /*****************************************************************/ MailMessage mail = new MailMessage(); mail.To = "Your Email Address"; mail.From ="hellin_zhang@hotmail.com"; mail.Subject = "hello, buddy" mail.Body = "Some text goes here"; mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1"); //basic authentication mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "hellin_zhang"); //set your username here mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "123456"); //set your password here SmtpMail.SmtpServer = "smtp.hotmail.com.com"; try{ SmtpMail.Send( mail ); }catch(Exception ex){ }
Hi Hellin, Thanks for the code. But I couldn't access the url u put there http://schemas.microsoft.com/cdo/configuration/smtpauthenticate and the other two cannot be accessed too. "Page cannot be displayed" when i open in the browser. Could you explain a bit whether hotmail provide such service? and is it possible if i use localhost? Thanks
-
using System.Web.Mail; /*****************************************************************/ MailMessage mail = new MailMessage(); mail.To = "Your Email Address"; mail.From ="hellin_zhang@hotmail.com"; mail.Subject = "hello, buddy" mail.Body = "Some text goes here"; mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1"); //basic authentication mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "hellin_zhang"); //set your username here mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "123456"); //set your password here SmtpMail.SmtpServer = "smtp.hotmail.com.com"; try{ SmtpMail.Send( mail ); }catch(Exception ex){ }
what is ur concept?