How to send mail from Godaddy? - Java Mail

UPDATED: 27 September 2011
Hello folks if you are using Goddady as you hosting site for JSP, Servlet, etc...We need to send mail from our domain to users. I'm giving you the steps how you can send mail using Java from your domain on Godaddy.

Step 1 : Login to your Goddady account
Step 2 : Login to web mail . To login click on Check my web mail.

Step 3 : Now You need your SMTP (Simple Mail Transfer Protocol) URL. Goto Help menu Click on Email Client

That will pop up your domain Incoming and Outgoing server URL

Now you need SMTP server URL : (*This is for my domain it may different for your domain)

Now the Code. I'm giving you the sample code. Change it as your domain.

private static final String SMTP_HOST_NAME = ""; //smtp URL
private static final int SMTP_HOST_PORT = 465; //port number
private static String SMTP_AUTH_USER = "Username"; //email_id of sender
private static String SMTP_AUTH_PWD = "Password"; //password of sender email_id

try {
    Properties props = new Properties();
    props.put("mail.transport.protocol", "smtps");
    props.put("", SMTP_HOST_NAME);
    props.put("mail.smtps.auth", "true");

    Session mailSession = Session.getDefaultInstance(props);
    Transport transport = mailSession.getTransport();
    MimeMessage message = new MimeMessage(mailSession);

    message.setContent("Message that you want to send", "text/html");
    Address[] from = InternetAddress.parse("");//Your domain email
    message.addRecipient(Message.RecipientType.TO, new InternetAddress("")); //Send email To (Type email ID that you want to send)

    transport.sendMessage(message, message.getRecipients(Message.RecipientType.TO));
} catch (Exception e) {
This is how you can send email from your Godaddy account. You need the API of Javamail Download from here Include it to lib folder.