Click here to Skip to main content
15,892,809 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to get all the software install in the machine [modified] Pin
MoustafaS9-Mar-07 3:26
MoustafaS9-Mar-07 3:26 
AnswerRe: How to get all the software install in the machine Pin
Thomas Stockwell9-Mar-07 12:45
professionalThomas Stockwell9-Mar-07 12:45 
QuestionHow to Retrieve Primary Key Column from an Existing Table in MsAcess Pin
BLekha8-Mar-07 22:04
BLekha8-Mar-07 22:04 
Questionvery simple question: what is the purpose of & in "" Pin
dino20948-Mar-07 22:00
dino20948-Mar-07 22:00 
AnswerRe: very simple question: what is the purpose of & in "" Pin
Stefan Troschuetz8-Mar-07 22:12
Stefan Troschuetz8-Mar-07 22:12 
AnswerRe: very simple question: what is the purpose of & in "" Pin
stancrm8-Mar-07 22:13
stancrm8-Mar-07 22:13 
QuestionUsercontrol and focus? Pin
Snowjim8-Mar-07 21:43
Snowjim8-Mar-07 21:43 
QuestionSystem.Net.Mail Problem... [modified] Pin
Jijo BP8-Mar-07 21:32
Jijo BP8-Mar-07 21:32 
Hi friends,

I am facing a PROBLEM WHILE I send mails with the SMTP class of System.Net.Mail.

The code shows below.

MailMessage mail = new MailMessage();

//set the addresses
mail.From = new MailAddress("from@domain.com");
mail.To.Add("to@domain.com");

//set the content
mail.Subject = "This is an email";
mail.Body = "this is the body content of the email.";


//send the message
SmtpClient smtp = new SmtpClient("mysmtpserver.net");


//to authenticate we set the username and password properites on the SmtpClient
smtp.Credentials = new System.Net.NetworkCredential("user@domain.com", "password");
smtp.Send(mail);



I have a valid smtp server name, username and password. I configured it to outlook and working fine. And wen I test it using telnet port 25 then also its working.


I upload the file to my hosting space. I have two hosting account with godaddy.

The mailing script is working fine in one hosting account. That hosting account have SSL and dedicated IP address.

But the mailing code is not working in the other hosting account. That hosting account is Windows hosting + ASP.NET 2.0 supported.


The error I am getting is as shown as below.






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 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 _Default.Button1_Click(Object sender, EventArgs e)



Please help me on this issue....
Thanks in advance....


-- modified at 5:38 Friday 9th March, 2007

JIJO BABY - Lets Play C#

AnswerRe: System.Net.Mail Problem... Pin
saeee8-Mar-07 23:39
saeee8-Mar-07 23:39 
GeneralRe: System.Net.Mail Problem... Pin
Jijo BP9-Mar-07 0:10
Jijo BP9-Mar-07 0:10 
AnswerWhy the open file handle ? [modified] Pin
Radu Sorin8-Mar-07 20:52
Radu Sorin8-Mar-07 20:52 
QuestionIE not showing popups Pin
RanjithLogics8-Mar-07 19:46
RanjithLogics8-Mar-07 19:46 
AnswerRe: IE not showing popups Pin
\laddie9-Mar-07 0:01
\laddie9-Mar-07 0:01 
GeneralRe: IE not showing popups Pin
RanjithLogics9-Mar-07 0:45
RanjithLogics9-Mar-07 0:45 
AnswerRe: IE not showing popups Pin
srivatsan249-Mar-07 10:57
srivatsan249-Mar-07 10:57 
QuestionTCP Socket Listening Pin
Member 36814438-Mar-07 19:06
Member 36814438-Mar-07 19:06 
AnswerRe: TCP Socket Listening Pin
stancrm8-Mar-07 19:29
stancrm8-Mar-07 19:29 
AnswerRe: Regarding active directory in Dot net Pin
\laddie8-Mar-07 18:59
\laddie8-Mar-07 18:59 
QuestionGet Number of users Pin
Rahul.RK8-Mar-07 18:30
Rahul.RK8-Mar-07 18:30 
AnswerRe: Get Number of users Pin
\laddie8-Mar-07 18:43
\laddie8-Mar-07 18:43 
GeneralRe: Get Number of users Pin
Rahul.RK8-Mar-07 19:27
Rahul.RK8-Mar-07 19:27 
GeneralRe: Get Number of users Pin
\laddie8-Mar-07 19:43
\laddie8-Mar-07 19:43 
QuestionWindows form question. Pin
NanaAM8-Mar-07 18:15
NanaAM8-Mar-07 18:15 
AnswerRe: Windows form question. Pin
\laddie8-Mar-07 18:36
\laddie8-Mar-07 18:36 
GeneralRe: Windows form question. Pin
NanaAM8-Mar-07 19:00
NanaAM8-Mar-07 19:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.