• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SmtpClient

 
unna kumar
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
While sending mail using sun.net.smtp.SmtpClient
we have to specify the MAIL_HOST in the coding itself.
How can I change the host according to the
MAIL_TO address.Suppose if I want to mail to one ID
in yahoo eg. name@yahoo.com then the host should
be www.yahoo.com, like wise if it is name@rediffmail.com
then the host shold be www.rediff.com.
Please help how to change the host wihtout getting
as input filed.
Thanks
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should never need to change the mail host once you have one which works. Email is a distributed system, and each host will forward the message to the appropriate destination for you.
Try it.
 
unna kumar
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for reply.
SmtpClient ss=newSmtpClient("mail.yahoo.com")
Using the above code, can I send email to a person having
email address other than yahoo.com. i.e.(Mail_To: name@usa.net)
I have tried this.It was not working.
But you have said that email is a distributed system, and each
host will send that email to appropriate destination.
Please help out.
Thankx again.
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It may be that mail.yahoo.com won't forward emails. Keep looking until you find a mail host which will. How do you get your internet connection? Almost all ISPs provide a mail host as part of the service.
 
unna kumar
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sir , I am connecting net thru VSNL.
I will try using www.vsnl.com as mail host.
Hope this will work.
Thankyou very much.
 
shashank hiwarkar1
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Correct me if I ma wrong........
Unna,

if u r using www.vsnl.com
then they are having their own mail host. You need to use that smtp host.
Now when you post anything@yahoo.com,
it will connect to the smtp host you specified.
That smtp host will connect to the gateway of the vsnl,through the routers.
Now ur request is at the gateway, this will distribute ur request depending on the address u specified, ie yahoo.
That means at the time of coading ur mail client u need to specify only ur smtp host.

Shashank
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've looked through the help pages at www.vsnl.com , especially the one at http://www.vsnl.com/english/userguide/netscape.htm and they recommend that you set
your SMTP server (for outgoing messages) to: 202.54.1.18 and
your POP3 server (for incoming messages) also to: 202.54.1.18
Try that and see how you get on.
 
unna kumar
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank You very much for your
immediate response.
Unna
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic