Error with SMTP

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
 
S

sloan

//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.
 
N

NishWishs

//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
 
S

sloan

//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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,705
Latest member
Stefkari24

Latest Threads

Top