 |
|
 |
Nice one... useful to every beginners...
|
|
|
|
 |
|
 |
hi,
i am trying to use your function in my server, but in my server there is no outlook installation,
so will this work without the outlook installation? i am getting an error in my servere "Failure sending mai"
thanks
regards
suis
|
|
|
|
 |
|
 |
can you be more specific and elaborate your error? May be with the stack trace and your code.
FYI:
This code has nothing to do with MS Outlook.
Department of Computer Science & Engineering,
University Of Moratuwa,
Sri Lanka.
|
|
|
|
 |
|
 |
hi ,
you code works fine in my local machine(outlook already installed on it) under port : "587",
but when i test this function in my local server it says "Failure sending mai" is this becasue in my local server has got no outlook installed on it?
thanks
regards
suis
|
|
|
|
 |
|
 |
Definitely No. This code does not depend on MS outlook. This code is used to send an Email from an ASP.NET web application using the Gmail servers. So it does not depend/need to depend on an email client such as MS outllok,etc. If the code is working in your local machine but not in the server(I don't understand what you meant by local machine and server and their differences), it means the problem is in your code most probably.
The comment on the port, Gmail service can be accessed via both 465 and 587. So feel free to use any of them.
Department of Computer Science & Engineering,
University Of Moratuwa,
Sri Lanka.
|
|
|
|
 |
|
 |
Hi,
i dont think any issues with my code, but the problem is same code running in my machine perfectly, so when i coppied the same code and trying to run in a different computer its showing me "Failure sending mail",
so the only difference in my machine and the other machines are bellow,
my machine
Windows XP
outlook configured
other machine
windows server 2003 64 eidtion
no outlook
so i can't guess what cause this error, any idea ?
thanks
regards
suis
|
|
|
|
 |
|
 |
Are these machines in the same network or are they in different networks? It may be a some network related issue such as proxy setting, etc which is causing this problem. Anyway I have tested this code from behind a proxy and a NAT and they worked perfectly. If both machines are in the same network I'm also clueless in that case. If they are in 2 different networks, then check the proxy settings and other related things. Theoretically it should work on any OS with the .Net framework. Btw I tested this code with .Net framework 3.5.check whether your server edition machine is equipped with it.
Department of Computer Science & Engineering,
University Of Moratuwa,
Sri Lanka.
|
|
|
|
 |
|
 |
Hi,
these two machines are in two different network,
i think there are some issues with the smtp port that we are gonna use,
i tried bellow port number in my network
465
587
25
its all work perfectly, but in my other network its not working,
thanks
regards
suis
|
|
|
|
 |
|
 |
That should be the cause of the error you get when you try to send the email. So try to contact the network administrator and work it out with him/her and try it again. Thanks for the information.
Department of Computer Science & Engineering,
University Of Moratuwa,
Sri Lanka.
modified on Thursday, April 1, 2010 5:33 AM
|
|
|
|
 |
|
 |
Hi Harshana,
many thanks for your followup emails,really appriciate it!
just to let you know my network administrator allowed "Telnet and SMTP in the shared firewall settings on the server." which sort out my problem,
now i can send emails using the different network too under the port id : 25
happy days .....
good luck for u r career(proud to be a SL)...
regards
suis
|
|
|
|
 |
|
|
 |
|
 |
Thanks Yar
|
|
|
|
 |
|
 |
The code is working when I connected with my broadband line.But when I connect via a proxy server in my office this code generates the folllowing message,
The remote name could not be resolved:'smtp.gmail.com'
|
|
|
|
 |
|
 |
When i run the code end up with the following exception
The remote name could not be resolved:'smtp.gmail.com'
Dias
Sri Lanka
amila
|
|
|
|
 |
|
 |
This message indicates that your DNS server was not able to resolve the Domain name "smtp.gmail.com".
First try this.
Type "nslookup smtp.gmail.com" in the command prompt. If this gives a IP address of Gmail smtp server you can try the program again.
If it fails again use the ip address of the gmail smtp server (which you get from the above DNS query) to replace "smtp.gmail.com" and try your program again.
If you get a message saying that the DNS query is unreolvable(cannot idntify the host specified or etc) it means your DNS server doesn't know how to resolve the domain name "smtp.gmail.com".
In that case you can't do nything at all. Just try to find what is the IP address of the gmail smtp server and use it instead of "smtp.gmail.com" and try your program.
Gud Luck
Department of Computer Science & Engineering,
University Of Moratuwa,
Sri Lanka.
|
|
|
|
 |
|
 |
THis is a good article, but you should also talk about the limitaions. I have found by using gmail or other internet mail accounts they are slow. You should talk about ways of makeing it faster such as threading.
|
|
|
|
 |
|
 |
Hi,
I get an error,
"The transport failed to connect to the server"
Exception Details: System.Runtime.InteropServices.COMException: The transport failed to connect to the server
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code
>>> Line 122: System.Web.Mail.SmtpMail.Send(Mail);
Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433
what should i do, please help me
ravis
|
|
|
|
 |
|
 |
This System.Web.Mail.SmtpMail.Send(Mail) is involked by using a web request to the server. So this may be a peoblem with your internet connectivity to server. otherwise this may be a problem in connecting to the server with credentials. I can't find the reason why it failed with this details. please send me the complete stack trace for the exception.
Make sure your internet connectivity works fine and try it again with correct gmail credentials.
Hope your effert will be succesful
Department of Computer Science & Engineering,
University Of Moratuwa,
Sri Lanka.
|
|
|
|
 |
|
 |
hi ,
i am a student and a rookie in asp.net. This article of has been of great help as i needed to send mails in a project i hv to make as a part of my syllabus.
But is there any way we can send mails without using gmail credentilas or for that matter of any other service provider?
Can we direcly send mails by specifying the MailMessage.to , MailMessage.from and the subject, body fields.And in smtpClient specifying our system as server. By this mean if i host my application my system's IIS , then can it be done ?
regards
aakash
|
|
|
|
 |
|
|
 |
|
 |
Of course
You can send mails with out gmail kind of public servers. Dats da easiest method. Unfortunately we cant use it always. Dats why we need gmail, yahoo public servers to work always.
watch this
http://www.asp.net/learn/videos/video-416.aspx[^]
Department of Computer Science & Engineering,
University Of Moratuwa,
Sri Lanka.
|
|
|
|
 |
|
 |
When I used the code, it was attempting to send the Email for almost 1min, and then throws an Operation Timed out Exception...
Please advice...
Thanks.
Alex.
http://www.hi-alex.com/
|
|
|
|
 |
|
 |
Actually i have not encountered with such an error before. So i will look in to it and help you. If some body knows the reason please help him with it. Even i need to know why.
Thanks.
Department of Computer Science & Engineering,
University Of Moratuwa,
Sri Lanka.
|
|
|
|
 |
|
 |
Hi, actually when I used port#587 instead of port#465, it seems to be working fine...
Dunno know why...
Alex.
http://www.hi-alex.com/
|
|
|
|
 |
|
 |
Wow. Sound interesting. Better to check what differences are there in port 465 n 587. But anyway they have proposed both 465 n 587 for our usage.
Thanks.
Department of Computer Science & Engineering,
University Of Moratuwa,
Sri Lanka.
|
|
|
|
 |