Click here to Skip to main content
15,896,154 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am on Proxy Server and want to send mail via gmail.but each time it shows message that "Unable to Connect to Remote Server".Please give me Solution .My Code is


Using smtp As New SmtpClient(127.0.0.1)
Using smtp As New SmtpClient("192.168.0.99")
smtp.EnableSsl = True
smtp.UseDefaultCredentials = True
smtp.DeliveryMethod = SmtpDeliveryMethod.Network
smtp.Timeout = 2000000
smtp.Credentials = New System.Net.NetworkCredential(txtUser.Text, txtPassword.Text, "smtp.gmail.com")
smtp.Port = 25
Dim UserToken As String = "test message1"
'smtp.SendAsync(mail, UserToken)
smtp.Send(mail)
End Using
Posted
Updated 2-May-14 2:41am
v2
Comments
Rohit rgdon 2-May-14 8:42am    
I have tried This But this is also not working.
Tanuj Rastogi 2-May-14 11:38am    
Make sure user credentials are valid and correct.
[no name] 2-May-14 16:17pm    
The port for GMail is not 25.
wikus70 5-May-14 4:51am    
Are you sure you can connect to this server? Try to ping the server and see if you get a reply.
bluesathish 12-May-14 6:09am    
Firewall port should open between the Gmail server and your server. Go to command Prompt and type telnet 192.168.0.99 25, Then if you get blank screen you've the firewall else port should be open.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900