is there anyway to send mail using yahoo or hotmail or others mail server?
here my code,
System.Web.Mail.MailMessag
e message=new System.Web.Mail.MailMessag
e();
message.From="xxx@yahoo.co
m" ;
message.To="xx@yahoo.com" ;
message.Subject="ddddd";
message.BodyFormat = MailFormat.Text;
message.Body="yyyyy"
message.Fields.Add("
http://schemas.microsoft.com/cdo/configuration/smtpserver","smtp.m
ail.yahoo.
com");
message.Fields.Add("
http://schemas.microsoft.com/cdo/configuration/smtpserverport",25)
;
message.Fields.Add("
http://schemas.microsoft.com/cdo/configuration/sendusing",2);
message.Fields.Add( "
http://schemas.microsoft.com/cdo/configuration/smtpauthenticate",
1 );
message.Fields.Add( "
http://schemas.microsoft.com/cdo/configuration/sendusername","use
rname");
message.Fields.Add( "
http://schemas.microsoft.com/cdo/configuration/sendpassword","pas
sword");
System.Web.Mail.SmtpMail.S
mtpServer=
"smtp.mail
.yahoo.com
";
but its can't work...
anything wrong with my code?
Start Free Trial