I am a beginner & was working on namespace system.web.mail. i was simply trying to mail a hello world message on the click of a button. BUT when i tried to do it i got an error message as follows System.Web.HttpException: Could not access 'CDO.Message' object. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException (0x80040213): The transport failed to connect to the server. i have not configured my outlook express is it due to that, or is there some other problem. please help me. my code was as follows private void button1_Click(object sender, System.EventArgs e) { sendemail(); } public static void sendemail() { SmtpMail.SmtpServer = "www.hotmail.com"; MailMessage mm = new MailMessage(); mm.From = "casablancaknight@hotmail.com"; mm.To = "casablanca111@hotmail.com"; mm.Body = "hello"; mm.Subject = "hi"; SmtpMail.Send(mm); }
VIJAYPAPUPAGER
Posts
-
error could not access cdo.message -
how do i make the value in text box permanenti am a begineer in c#,and am not getting exact technical terms to explain my problem, though i shall try my best.i have developed a program which takes values from a textbox. its obvious that when i run the program for second time the previously entered values through textbox will get wiped out & textbox will ask for new values. how do i avoid this? how do i make program to run as may times as i want on the values i entered for first time when i ran the program? & only take new values when i change the contents of textbox & continue with this values for any number of times i run the program.
-
i am not able to use the name space system.webHi iam a beginner in c# & recently i was planning to build a web application but iam not able to use namespace system.web cause my compiler is not able to recognize it. what's the reason? should i import it from somewhere else?if yes from where & how do i import? please help me.:confused:
-
Is it possible to access a variable declared in c# in an html pageI am designing an html redirector page now since the ip of my computer keeps on changing i developed an application to detect whenever there is a change in my computers ip address this ip address is stored in a variable in my application now i want to put this variable in html redirector page is it possible.