Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Email question: Unable to send mail to mymailid@yahoo.com

Email question: Unable to send mail to mymailid@yahoo.com

Email question: Unable to send mail to mymailid@yahoo.com

Hi all,

I am able to send mail to my office account but when I try to send it to out side i.e my yahoo id, I am unable to receive the mail . It does not give any error message also..


            Email email = new Email();
            email.setContent("Test Email");
            email.setSubject("Test subject  " );
            email.setSentDate(new Date(System.currentTimeMillis()));
            try {
            } catch (UnsupportedEncodingException e) {
            } catch (MessagingException e) {

and here is the email sender.


    public static void sendEmail( Email email ) throws MessagingException, UnsupportedEncodingException {    
        //String SYSTEM_EMAIL = SystemProperties.getProperty("system.emailAddress");
        //String SYSTEM_NAME = SystemProperties.getProperty("system.emailDisplay");
        String SYSTEM_EMAIL = "karthik@starry-associates.com";
        String SYSTEM_NAME = "starry-associates.com";
        boolean debug = false;
        //Set the host smtp address
        Properties props = new Properties();
        props.put("mail.transport.protocol", "smtp");

        /* props.put("mail.smtp.host", SystemProperties.getProperty("system.mailServer"));
           props.put("mail.host", SystemProperties.getProperty("system.mailServer"));      */

        props.put("mail.smtp.host", "mail01");
        props.put("mail.host", "mail01");
        // create some properties and get the default Session
        Session session = Session.getDefaultInstance(props, null);
        // create a message
        MimeMessage msg = new MimeMessage(session);
        // set the from address and full name
        InternetAddress addrFrom = new InternetAddress(SYSTEM_EMAIL, SYSTEM_NAME);
        // set the replyTo address
        InternetAddress[] addrReplyTo = new InternetAddress[1];
        addrReplyTo[0] = new InternetAddress(SYSTEM_REPLY_TO);
        // set the TO address
        InternetAddress[] addrTo = new InternetAddress[1];
        addrTo[0] = new InternetAddress(email.getReceipientEmail());
        msg.setRecipients(Message.RecipientType.TO, addrTo);
        // Setting the Subject and Content Type
        msg.setContent(email.getContent(), "text/html");        
        // setting the Flag or Priority
        if (email.isFlagged()) {
            Flags flags = new Flags();
            msg.setFlags(flags, true);
            msg.addHeader("Priority", "Urgent");
            msg.addHeader("Importance", "high");            
        // properly set the sent date
        msg.setSentDate(new Date(System.currentTimeMillis()));

        log.debug("Sending email from "+email.getSender());

        //String mailServer = SystemProperties.getProperty("system.mailServer");
        //String account = SystemProperties.getProperty("system.mailAccount");
        //String passwd = SystemProperties.getProperty("system.mailPassword");

        String mailServer = "mail01";
        String account = "karthik";
        String passwd = "4321";
        if (passwd==null) passwd="";
        // using the non-static version so we can connect with a NULL password
        Transport transport = session.getTransport("smtp");
        transport.connect(mailServer, account, passwd);
        transport.sendMessage(msg, msg.getAllRecipients());

Thanks to all in advance..

RE: Email question: Unable to send mail to mymailid@yahoo.com

I am sorry if this forum is not the right one..
I will post this is java forum..

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close