#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Chennai,TamilNadu,India
    Posts
    33
    Rep Power
    15
    How to send mails using SMTP in Servlets or there are any way to send mails without using SMTP.

    Raghu.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Posts
    35
    Rep Power
    15
    The short answer (without looking it up) :
    - connect to a SMTP server of your choice, port 25
    - send (on separate lines):
    - HELO yourdomain.com
    - mail from: you@sender.com
    - rcpt to: someone@receiver.com
    - data
    - Subject: the subject
    (blank line)
    - 1 or more lines of text (mail body)
    - . (just 1 period on a single line)
    - QUIT (to break the connection)

    You can try this by telnetting to port 25 on your server and trying the above, to see what the server responses are. Note: the domain in the HELO message does not really matter, put what you like.
    Also I did a quick lookaround and found an open-source mail servlet on http://www.coolservlets.com/CSMailForm/ .

    Success, Ton

IMN logo majestic logo threadwatch logo seochat tools logo