No, You cannot enable server for smtp from your code due to security reason. As i know, none of the service provider gives us this facility to enable from code. You can do it by using their admin panel.
The miracle is this--the more we share, the more we have.
I Used this and different code from google also. but am getting the following error.Should i do some setting changes or something in the email account?
Send failure: System.Net.Mail.SmtpException: Failure sending mail. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 126.96.36.199:587 at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) --- End of inner exception stack trace --- 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 Mail.btSend_Click(Object sender, EventArgs e) in e:\Uzhavoor_Project\Mail.aspx.cs:line 46
Sir , In my application wht i m doing is ,there is page in which user is pasting there mobile numbers and message n then pressing send button ,in back end i m running loop to catch no. and sending msg. one by one,in this process ,if there is 1000 no. then its taking long time in loop. i want to know tht is there any way to increase the performance of my application , my applcaiton is not on dedicated server , n my hosting provider is having good band width also. so i think there is no issue with band with n data tranfer here , so how is increase the performace of my application ,plz help me .
i have page in which i have master page
on tht master page i have differnt links..
when user click on any link ..i want to change the colour of tht link
means he will gwt o knw ehich link has been click
it works upto clicking...but onces page get relaoded its back to its normal colour
bcz master page get load again
I am doing a project. It consists of Photo gallery. I want to display all the recent photos stored 2 days before. I have a field called stored_date. How to achive this using SQL. Can anyone tell the code?
You can also try this if you want to use the query
select * from table_name where convert(datetime,convert(varchar(30),stored_date,103),103)
I want to have a refresh that recalls the database to pick up changes. I have timers set up on different pages that call the database. (using System.Timers.Timer() ) But if a user moves to different page that has another timer I get more than one timer calling the database and this is bad for performance. What is the standard way to handle an automatic refresh?
Thanks in advanced