Error with SMTP

  • Thread starter Thread starter NishWishs
  • Start date Start date
N

NishWishs

i was trying to send comments from my application(using a wizard) to
my email.

Iam working on same problem today from a diffrent IP location from
yeterday, iam getting fallowing error

A socket operation was attempted to an unreachable network
209.85.237.25:25

and the code i written was

protected void Wizard1_FinishButtonClick(object sender,
WizardNavigationEventArgs e)
{
SendMail(emailTB.Text, commentsTB.Text);
}
private void SendMail(string from, string body)
{
string mailServerName = "smtp.google.com";
MailMessage message = new MailMessage(from,
"(e-mail address removed)", "feedback", body);
//SmtpClient client = new SmtpClient(server, port);
SmtpClient mailClient = new SmtpClient("SMTPserver",25);
mailClient.Host = mailServerName;
mailClient.Credentials =
CredentialCache.DefaultNetworkCredentials;

mailClient.Send(message);
message.Dispose();
}
}

Plz Help ME
 
//Plz Help ME//

I tried to help you.

I gave you a URL to a known-to-be-working gmail sample.
Let me repeat for emphasis. An example that is KNOWN TO WORK WITH GMAIL.


All you have to do is download it. Make 2-3 changes. Then you'll have a
working example of smtp with gmail.

..........

http://sholliday.spaces.live.com/Blog/cns!A68482B9628A842A!138.entry


There is the URL again. Download the code.

Here is the line to find in the blog entry:
You can download the code HERE. (Right-Click and "Save As" works best)



Now, if you download the code and cannot get it to work, then that's one
thing.
 
//Plz Help ME//

I tried to help you.

I gave you a URL to a known-to-be-working gmail sample.
Let me repeat for emphasis.  An example that is KNOWN TO WORK WITH GMAIL.

All you have to do is download it.  Make 2-3 changes.  Then you'll have a
working example of smtp with gmail.

.........

http://sholliday.spaces.live.com/Blog/cns!A68482B9628A842A!138.entry

There is the URL again.  Download the code.

Here is the line to find in the blog entry:
You can download the code HERE. (Right-Click and "Save As" works best)

Now, if you download the code and cannot get it to work, then that's one
thing.

still its not working

anybody plz help me out
 
//still its not working//


What is not working?


Which line of the code you downloaded is not working?


What is the Exception.Message and the Exception.StackTrace ?

Did you try changing the port numbers for the gmail setting on the config
file?





//Plz Help ME//

I tried to help you.

I gave you a URL to a known-to-be-working gmail sample.
Let me repeat for emphasis. An example that is KNOWN TO WORK WITH GMAIL.

All you have to do is download it. Make 2-3 changes. Then you'll have a
working example of smtp with gmail.

.........

http://sholliday.spaces.live.com/Blog/cns!A68482B9628A842A!138.entry

There is the URL again. Download the code.

Here is the line to find in the blog entry:
You can download the code HERE. (Right-Click and "Save As" works best)

Now, if you download the code and cannot get it to work, then that's one
thing.

still its not working

anybody plz help me out
 
Back
Top