Smtp mail client socket problem

As soon i enter the smtp server address (smtp.mail.yahoo.com) i get the following:
Exception in thread "main" java.net.UnknownHostException: smtp.mail.yahoo.com: smtp.mail.yahoo.com
        at java.net.InetAddress.getAllByName0(InetAddress.java:1128)
        at java.net.InetAddress.getAllByName0(InetAddress.java:1098)
        at java.net.InetAddress.getAllByName(InetAddress.java:1061)
        at java.net.InetAddress.getByName(InetAddress.java:958)
        at MailTest.<init>(MailTest.java:20)
        at MailTest.main(MailTest.java:97)
Java Result: 1
BUILD SUCCESSFUL (total time: 11 seconds)
import java.util.*;
import java.net.*;
import java.io.BufferedReader;
import java.io.*;
public class MailTest
    String from;
    String to;
    String smtp; //smtp.mail.yahoo.com
    String hostName;
    BufferedReader brin;
    PrintWriter pwout;
    String communication;   
    public MailTest() throws UnknownHostException,IOException
        readMailData();       
        Socket s=new Socket(InetAddress.getByName(smtp), 25);
        //tried also smtp.plus.mail.yahoo4.akadns.net and with the
        //corresponding ip
        hostName=InetAddress.getLocalHost().getHostName();
        brin=new BufferedReader(new InputStreamReader(s.getInputStream()));       
        pwout=new PrintWriter(s.getOutputStream());               
        receive();
        send("HELO "+ hostName);
        receive();
        send("MAIL FROM: <"+from+">");
        receive();
        send("DATA");
        receive();       
        send(readMessageBody());
        send(".");
        receive();
        s.close();
    private void receive() throws IOException
        System.out.println("Incoming Communication");
        System.out.println("-----------------------------------------");
        while (!(communication=brin.readLine()).equals(null))
            System.out.println(communication);
        System.out.println("-----------------------------------------");
    private void send(String s) throws IOException
        System.out.println("Outcoming Communication");
        System.out.println(s);
        pwout.write(s);
        pwout.flush();
        System.out.println("-----------------------------------------");
    private String readMessageBody() throws IOException
        String q="";
        String msgBuffer="";
        BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
        System.out.println("--------------Message--Body--------------");
        System.out.println("enter -Enter-quit-Enter- to exit");
        System.out.print(">");       
        q=in.readLine();       
        while (!q.equals("quit"));
            msgBuffer+=q;
            System.out.print(">");
            q=in.readLine();           
        System.out.println("-----------------------------------------");
        return msgBuffer;
    private void readMailData() throws IOException
        BufferedReader in= new BufferedReader(new InputStreamReader(System.in));                       
        System.out.println("From: ");
        from=in.readLine().trim();
        System.out.println("To: ");
        to=in.readLine().trim();
        System.out.println("SMTP server: ");
        smtp=in.readLine();       
    public static void main(String[] args) throws UnknownHostException, IOException           
        MailTest mt=new MailTest();
}

I would say you have a DNS problem, or perhaps you aren't connected to the Internet. Can you ping smtp.mail.yahoo.com? or at least can ping resolve the name?

Similar Messages

  • HT2693 hello, HP LaserJet 400 colorMFP M475dw printers smtp mail client doesnt work. Bad username or password. everything is correct. Any idea?

    hello, HP LaserJet 400 colorMFP M475dw printers smtp mail client doesnt work. Bad username or password. everything is correct. Any idea?

    Solved, just had to change the hostname order in /etc/hosts (I need to correct this on the arch wiki) :
    Before :
    127.0.0.1 localhost.localdomain localhost BodyArch-PC
    ::1 localhost.localdomain localhost BodyArch-PC
    After :
    127.0.0.1 localhost.localdomain BodyArch-PC localhost
    ::1 localhost.localdomain BodyArch-PC localhost

  • Sending mail with mail client failure problem

    My installation config :
    Solaris 10
    Sun Java(tm) System Messaging Server 7.3-11.01 64bit (built Sep 1 2009)
    single host installation
    since past few days , I encounter a new problem with SJMS after finish installation . When using mail client Thunderbird 2.0.0.23 , sending mail message to outside email providers / non-local (e.g correctly typed yahoo/gmail) domain always failed whenever I use from outside networks/Internet ( smtp setting in mail client require username and password authentication ) . however,users between the same local domain is OK .
    The thunderbird always prompt :
    " The mail server responded: Recipient address rejected: User unknown. Please check the message recipients and try again "
    The problem does not occured when I was using inside LAN and connected locally with the server host .
    but, I am able and succesful to telnet to port 25 using command via outside the network, indicating the port and server not being blocked by firewall :
    telnet smtp.abcxyz.com 25
    220 ***************************************
    any help is welcome.
    Thanks

    I would be good to have the full output from the "imsimta version" command. That gives OS information too, which may not be pertinent to this specific problem, but it is better to give all the info than for us to wish we had it.
    Also, what is the full, exact error message you get when you try this with telnet to port 25 and it fails? It may be significant to see the exact text because it could be coming from some intermediate device rather than the Messaging Server itself.
    If you are getting connected to the Messaging Server's MTA, you should find some indication of this in the mail.log_current file. If not, I would say to make sure the "logging" keyword is on the "defaults" channel and add LOG_CONNECTION=3 LOG_PROCESS=1 LOG_USERNAME=1 to option.dat and do imsimta cnbuild; and imsimta restart dispatcher. Then repeat the test. If you still get nothing in mail.log_current about that test, then I would conclude the connection is not getting to the Messaging Server's MTA but rather the failure is coming from a firewall or some other intermediate device.
    If your mail client authenticates to the MTA when trying to send mail from outside your network, this should result in the message submission being switched to the tcp_auth channel instead of tcp_local and that should allow the message to go thru. If the connect is making it to the MTA and being rejected there, it will be interesting to see which channel is involved. The mail.log_current records should show that.

  • Client Socket Problem: retrieving data from my Simple http Server...

    here's the main part of the "sending" of data from my server class:
    write(b.getBytes());
    outtStream.write(version.getBytes());
    outStream.write(replyCode.getBytes());
    here the server sends the data back to the client...i've tested this on a webbrowser and got a correct response...
    now in my client side, I'm having problems...
    1) I dont know how to retrieve the data from the outStreams above...
    2) Can anyone give me some help plz...or descriptive sample code
    here's the main part of the client sending its data first from the user input(client) and then sending the data...(ive created the socket)
    input = new BufferedReader(new InputStreamReader(System.in));
    output = new PrintWriter(socket.getOutputStream(),true);
    while((message = input.readLine()) != null)
    output.println(message);//sends the client's input to server?
    System.out.println(input.readLine());//retrieves server's response
    //then outputs it

    also i tried adding
    input = new BufferedReader(new InputStreamReader(socket.getInputStream()));
    after the System.in one and still no luck :[                                                                                                                                                                                                                                                                                               

  • Yosemite Mail Client and safari OWA problem

    I was upgrade my mac system to Yosemite from Mavericks.
    I can login OWA but i can't browse e-mails and folders Also I have  Mail client syn problem with Exchange. Unable to get all e-mails with mail client.
    How to solve this problems.

    I have similar symptoms.
    The iCloud pane in System Preferences says "Starting..." and never finished.
    Adding an account in OS X Mail prompts me for the Incoming Mail Server, even though it recognizes it as an iCloud account. Leaving leaving the field empty results in Mail unable to connect to the server.
    Clicking on Mail in the iCloud web interface tells me I need to create an @me.com email address by enabling Mail in the iCloud System Preference.
    I am using an existing MobileMe account (previously a .Mac account) which is my AppleID.

  • Default mail client setting?

    Since my desktop software was upgraded, everytime I open it...I get the message that "Either there is no defaul mail client or the current mail client cannot fulfill the messaging request.  Please run Microsoft Outlook and set it as the default mail client."
    Problem is...I opened up MS Outlook and it **is** set as the default mail client.....so what gives?  
    Solved!
    Go to Solution.

    Uninstall Desktop Manager:
    http://www.blackberry.com/btsc/microsites/search.do?cmd=displayKC&docType=kc&externalId=KB02206&slic...
    Obtain the latest DM software:
    http://na.blackberry.com/eng/services/desktop/
    Launch your default email client.
    Reinstall DM from the latest download.
    Occam's Razor nearly always applies when troubleshooting technology issues!
    If anyone has been helpful to you, please show your appreciation by clicking the button inside of their post. Please click here and read, along with the threads to which it links, for helpful information to guide you as you proceed. I always recommend that you treat your BlackBerry like any other computing device, including using a regular backup schedule...click here for an article with instructions.
    Join our BBM Channels
    BSCF General Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • Setting up a mail client and the outgoing SMTP set...

    If you switch to BT and you already have email accounts set up in a mail client such as Mac Mail, you will not find any help from BT to set up correct outgoing SMTP mail server settings. Most other ISP's are usually very helpful with this but BT have a policy that is designed to make things very difficult to use anything but a BT email account. They claim that it is "To protect our email server from abuse by spammers". However, the solution to this has potentially quite the opposite effect as you will not be able to enable SSL for it to work!!
    OK so the first thing to do is create a new 'MY BT' account and then go to 'email' and create a new BT email account. Keep a note of address and password as you will need this later.
    Go back to the main BT home page and click on mail. You should land on a page that has the new 'BT Mail Account' in the left column and above a purple tool bar with 'Settings at the end. Click on 'Settings'.
    In the left column, underneath 'Mail' click on 'Accounts'
    Click 'Add' and fill in the details of your 3rd party (Non BT) account. They encourage IMAP only but I used 'POP" with no problems as I have no intention of using the BT mail client.
    In 'Mail settings' fill out the mail server details from your email provider or where your site is actually hosted. For example if you are using 000webhost.com then they will advise 'mx.000webhost.com' or may be 'mail.yourwebsitename' 
    The correct port to enter is the port listed in your web client. For me with Mac Mail then this is listed in preferences and if you check this then also double check that use SSL is NOT checked
    Enter the email user name and password of your 3rd party account
    Make sure in 'Security' that 'Requires SSL' is NOT checked
    Then save the account
    Click on the 'Email' link in the purple tool bar and there now under the 'BT Mail Account' should be your 3rd party account. Click on it and it should now load your email. If it doesn't then you will have to try again the steps above as there is no point in going any further if the BT client cannot access your account.
    OK if it is working then go to your email client (Mac Mail in my case) and in preference set up your 3rd party account as follows.
    Incoming mail server is as the info from your host ( like as in 'mx.000webhost.com' above). Enter user name and password for the 3rd party account.
    Now set up an Outgoing mail server (SMPT). I just called it BT with the server name 'mail.btinternet.com'. In the advance section click use default ports. It actually uses 465 if you do not have a default option.
    Do NOT enable SSL
    Set Authentication to 'Password'
    Then in user name enter the details of the NEW BT account you opened for user name and password.
    And that's it. Well it works for me! I got no assistance whatsoever from BT in trying to solve this. I asked to cancel my new BT infinity service after only 5 days when it proved so difficult to get an email client like mac mail to work. I had 4 calls from them and even the 'Tech Experts' had no idea what I was talking to them about!

    Melski wrote:
    Ah yes Thank you Oliver that is a better solution. However all the settings in the BT client have to remain as no SSL. If you change to use SSL there you will not be able access the 3rd party email account.
    Your email client cannot handle SSL for SMTP (BT) and non-SSL for POP3 (000webhost)?
    Oliver.

  • Cannot send to some receipients with error "550-Please turn on SMTP Authentication in your mail client"

    I am using exchange 2003 connected using MAPI with outlook2010.
    when i send e-mail to one of my customer.
    i got below error message
    There was a SMTP communication problem with the recipient’s email server.  Please contact your system administrator.
    <xxxx.net #5.5.0 smtp;550-Please turn on SMTP Authentication in
    your mail client. >
    xxxx.net was my server
    and my customer was using messagelabs "cluster6a.us.messagelabs.com" to receive mail
    i was strange that MAPI connect does not need smtp authentication when send out e-mail.
    is that anythings i have missing to do?
    thank you

    Hello,
    Kindly go through with below link.
    http://www.experts-exchange.com/Software/Server_Software/Email_Servers/Exchange/Q_28133927.html
    http://www.experts-exchange.com/Software/Server_Software/Email_Servers/Exchange/Q_28078232.html
    Deepak Kotian.
    MCP, MCTS, MCITP Server / Exchange 2010 Ent. Administrator
    Disclaimer:
    Please take a moment to "Vote as Helpful" and/or "Mark as Answer", where applicable.
    This helps the community, keeps the forums tidy, and recognizes useful contributions. Thanks!
    All the opinions expressed here is mine. This posting is provided "AS IS" with no
    warranties or guarantees and confers no rights.

  • Please turn on SMTP Authentication in your mail client in ecxhange

    Hi guys i am getting the following in Undeliverable mail.
    Delivery has failed to these recipients or groups:
    [email protected] ([email protected]) A problem occurred during the delivery of this message to this e-mail address. Try sending this message
    again. If the problem continues, please contact your helpdesk.
    The following organization rejected your message: cms.cms-ss.net.
    Diagnostic information for administrators:
    Generating server: cmssrv.cms.local
    [email protected] cms.cms-ss.net #550-Please turn on SMTP Authentication in your mail client. 550-213-180-200.netrunf.cytanet.com.cy (cmssrv.cms.local) 550-[213.149.180.200]:14544
    is not permitted to relay through this server 550 without authentication. ##
    Original message headers:
    Received: from cmssrv.cms.local ([fe80::4441:f16c:7e2:3085]) by
    cmssrv.cms.local ([fe80::4441:f16c:7e2:3085%17]) with mapi; Wed, 16 Jul 2014
    10:51:16 +0300
    From: Stavros Mavrommatis <[email protected]>
    To: "[email protected]" <[email protected]>
    Subject: stav1
    Thread-Topic: stav1
    Thread-Index: Ac+gyqeEulARc2WGQ+SGhAfPAfQIXg==
    Disposition-Notification-To: Stavros Mavrommatis
            <[email protected]>
    Date: Wed, 16 Jul 2014 07:50:50 +0000
    Message-ID: <[email protected]>
    Accept-Language: en-GB, en-US
    Content-Language: en-US
    X-MS-Has-Attach:
    X-MS-TNEF-Correlator:
    Content-Type: multipart/alternative;
            boundary="_000_5CB2426E90E0264D95475ACA2688E10E34FF4880cmssrvcmslocal_"
    MIME-Version: 1.0
    This started after windows updates. When i tried to send an email thought an account that is connected to exchange i get this email. if i retry to send the same email, the second time it goes normally. This is happening on all emails that are connected to
    the exchange. I tried to send emails though pop3 and they are going normally.
    PS: Exchange 2010 with windows server 2008 r2

    Hi,
    Does this issue only occur on the [email protected] account? How about other Gmail account?
    According to the error message, it seems that, it need to turn on SMTP Authentication in your mail client.
    Find a similar thread for your reference:
    Mail rejected because of 550 enable authentication error
    http://social.technet.microsoft.com/forums/exchange/en-US/932093f9-cca5-40a5-a659-5d69c8d23c33/mail-rejected-because-of-550-enable-authentication-error
    Thanks
    Mavis
    Mavis Huang
    TechNet Community Support

  • Since iOS 8.1.2 upgrade problems with yahoo mail via apple mail client

    Since the upgrade to iOS 8.1.2 on my iPad I'm having issues with my yahoo mail account when using the apple mail client. I can send emails but cannot receive them. When I use the yahoo mail app there is no problem Sending or receiving. I have deleted and reinstalled my yahoo email account from the apple mail client. I have checked the wifi by changing between wifi hotspots. I have also restarted the iPad as well as resetting. None of these actions have resolved the problem. would appreciate any assistance that can be provided.

    Do you use two-step verification for your Yahoo! account? If yes, you need an app-specific password.
    If no, make sure your password is already entered in the "Outgoing Mail Server" in the Settings app.

  • TS4363 I have problem with mail client in Mountain Lion

    I use the iPhone 4 and iPad2 on both devices I Exgange server communication with the server is no problem, but in Mountain Lion I am unable to set the mail client, so to function properly.
    I really tried all the advice but nothing worked.
    I do not get it. Why it on both devices works great, but the MacBook Pro it does not work at all.
    Does anybody have similar experience and know someone solution?
    Thanks for your help

    http://www.apple.com/support/osx/mail/

  • Problem when send an email with mail client!

    Hi!
    My mail server have MTA front end and Message Store back end with version:
    ./imsimta version
    Sun Java(tm) System Messaging Server 7u2-7.02 64bit (built Apr 16 2009)
    libimta.so 7u2-7.02 64bit (built 02:28:03, Apr 16 2009)
    Using /opt/sun/comms/messaging64/config/imta.cnf (compiled)
    SunOS SMSG 5.10 Generic_139556-08 i86pc i386 i86pcMy users and I are having problem following: Send an email very slow, mail client is connected to front end but mail is not delivered, after that, I stop and resend this email several times then it is can delivered. While the mail was not send, i can telnet to front end with port 25. My users and I are using Thunderbird and Microsoft Outlook. What is problem on my mail server ?
    I see time on MTA front end and Message Store are not synchronized, maybe this could be the problem?
    Thanks!

    NguyenPhuc wrote:
    Are you using any kind of MTA spam filter plugin?I removed plugin spam filter, now on MTA server don't have plugin spam or virus !Are you saying you did have a spam filter plugin enabled (if so which one(s)) and you have just disabled it?
    Are you receiving an excessive number of emails?No, total of number messages in my mailbox is about 1000 emails.I meant is the MTA receiving a large number of emails -- i.e. do you see a lot of emails coming in (mail.log_current)?
    Also try the following and see where the delay in accepting emails occurs:
    telnet <mta> 25
    mail from: [email protected]
    rcpt to: [email protected]
    data
    Subject: test email
    To: [email protected]
    From: [email protected]
    body
    .e.g.
    -bash-3.00# telnet server 25
    Trying 10.15.10.33...
    Connected to server.aus.sun.com.
    Escape character is '^]'.
    220 server.aus.sun.com -- Server ESMTP (Sun Java(tm) System Messaging Server 7u3-16.01 64bit (built Apr  6 2010))
    mail from: [email protected]
    250-2.5.0 No HELO/EHLO seen; continuing anyway, [10.15.10.33].
    250 2.5.0 Address Ok.
    rcpt to: [email protected]
    250 2.1.5 [email protected] OK.
    data
    354 Enter mail, end with a single ".".
    To: [email protected]
    From: [email protected]
    body
    250 2.5.0 Ok, envelope id [email protected]
    quit
    221 2.3.0 Bye received. Goodbye.
    Connection to server.aus.sun.com closed by foreign host.Regards,
    Shane.

  • Problem to receive mail with Apple Mail client

    Apple Mail cannot receive mail. Mail is sent without any problems. I thought that it may have to do with my iPhone but when it is shut down I still get this error.
    The error message that I get is:
    Unable to Receive Mail
    The mail server denied access to the account "xxxxxxx" because an administrator or other mail client was using it when Mail tried to log in. Please try again later.
    The server error encountered was: Unable to lock maildrop: Mailbox is locked by POP server.
    Does anyone have any suggestions on how to proceed?

    I determined the problem had to do with other computers configured with POP (same account) locking the mailbox. Moral of the story is to just have one computer configured with POP and all the rest with IMAP.

  • Problem with built mail client E66

    Hi, today I noticed a problem that I just disappeared built mail client and with mails. When I will create a new mailbox, it still gives me the opportunity, only Nokia Messaging ...
    Can you help me with this??
    THX

    bruxxx wrote:
    Why is it that a free mail client like Thunderbird can do better than both Apple and Microsoft at solving this problem ... though it is not completely solved by either?
    Because most users have no idea what cached connections are. They just want it to work.
    Perhaps you should submit a bug report to Apple

  • My problem is after updating to Yosemite does my mail client any longer. I can not even open the mail, and when I "forced closes" mail and try to open it again to go in the entered settings running the colored wheels around and allows me only to forc

    My problem is after updating to Yosemite does my mail client any longer. I can not even open the mail, and when I "forced closes" mail and try to open it again to go in the entered settings running the colored wheels around and allows me only to forcing close again? does anyone have a solution to the above problem?

    You mean the default OS X mail app? Try reinstalling OS X Yosemite if that's the case.
    If you are referring to 3rd party mail applications, that's a compatibility issue. Some apps don't work in the new operating system. You have to wait until the developer updates the app, or you have to revert back to Mavericks to continue using it.

Maybe you are looking for