Help sending e-mail

Hi there,
I am having a problem like alot of people have had when sending e-mail to a smtp server.
The below program is the my SMTP client.
When sending an e-mail to my own ISP's server smtp.homechoice.co.uk, with my allocated e-mail address from them, this works fine proving that I can send an e-mail to myself.
However if I enter in another e-mail address at another domain like [email protected], I get the below error:
Is this some kind of authentication issue?
javax.mail.SendFailedException: Sending failed;
nested exception is:
class javax.mail.SendFailedException: Invalid Addresses;
nested exception is:
class javax.mail.SendFailedException: 553 sorry, that domain isn't in my
list of allowed rcpthosts (#5.7.1)
at javax.mail.Transport.send0(Transport.java:218)
at javax.mail.Transport.send(Transport.java:80)
at MessengerFrame$3.run(MessengerFrame.java:1599)
at java.lang.Thread.run(Thread.java:534)
public class SMTPClient extends JFrame
     private JButton sendButton = new JButton("Send Message");
     private JLabel fromLabel = new JLabel("From: ");
     private JLabel toLabel = new JLabel("To: ");
     private JLabel hostLabel = new JLabel("SMTP Server: ");
     private JLabel subjectLabel = new JLabel("SMTP Server: ");
     private JTextField fromField = new JTextField(40);
     private JTextField toField = new JTextField(40);
     private JTextField hostField = new JTextField(40);
     private JTextField subjectField = new JTextField(40);
     private JTextArea message = new JTextArea (10, 72);
     private JScrollPane jsp = new JScrollPane(message);
     public SMTPClient()
          super("SMTP CLient");
          Container contentPane = this.getContentPane();
          contentPane.setLayout(new BorderLayout());
          JPanel labels = new JPanel();
          labels.setLayout(new GridLayout(4,1));
          labels.add(hostLabel);
          JPanel fields = new JPanel();
          fields.setLayout(new GridLayout(4,1));
          String host = System.getProperty("mail.host", "");
          hostField.setText(host);
          fields.add(hostField);
          labels.add(toLabel);
          fields.add(toField);
          String from = System.getProperty("mail.from", "");
          fromField.setText(from);
          labels.add(fromLabel);
          fields.add(fromField);
          Box north = Box.createHorizontalBox();
          north.add(labels);
          north.add(fields);
          contentPane.add(north, BorderLayout.NORTH);
          message.setFont(new Font("Monospaced", Font.PLAIN, 12));
          contentPane.add(jsp, BorderLayout.CENTER);
          JPanel south = new JPanel();
          south.setLayout(new FlowLayout(FlowLayout.CENTER));
          south.add(sendButton);
          sendButton.addActionListener(new SendAction());
          contentPane.add(south, BorderLayout.SOUTH);
          this.pack();
          //add(pane);
     class SendAction implements ActionListener
          public void actionPerformed(ActionEvent evt)
               try
                    Properties props = new Properties();
                    props.put("mail.host", hostField.getText());
                    Session mailConnection = Session.getInstance(props, null );
                    //Store store = mailConnection.getStore(provider);
                    //store.connect(host, username, password);
                    final Message msg = new MimeMessage(mailConnection);
                    Address to = new InternetAddress(toField.getText());
                    Address from = new InternetAddress(fromField.getText());
                    msg.setContent(message.getText(), "text/plain");
                    msg.setFrom(from);
                    msg.setRecipient(Message.RecipientType.TO, to);
                    msg.setSubject(subjectField.getText());
                    Runnable r = new Runnable()
                         public void run()
                              try
                                   Transport.send(msg);
                              catch (Exception e)
                                   e.printStackTrace();
                    Thread t = new Thread(r);
                    t.start();
                    message.setText("");
               catch (Exception e)
                    e.printStackTrace();
}

Hi,
i m a new programmer in java. I just started programming. Please help me to send a mail through java
How can i get a smtp server. I have windows xp and using jdk1.4
since u have send mail at least to ur addres. U can help me .
Hope u will be a good tutor to me.
Bye
Binoy Debnath.
mail me in
[email protected]
[email protected]

Similar Messages

  • Need  help sending e-mail a mobile messages

    hi!
    i'm a n00b in Java. Can you please tell how can i send e-mail and mobile messages in java?
    thnx!!

    First of all, before you do any programming, if you want to have your computer send e-mail messages then you must have access to an SMTP server.
    Next, if you do have access to one, then JavaMail is a common way to write programs that send e-mail.
    As for mobile messages ("text messages" to a cellphone?) you usually need a contract with some phone company to do that, so they can bill you for it.
    When you find out about that, they should provide you with documentation on how to proceed. If it involves sending e-mail to a particular address, see part 1 of this reply.

  • Help sending/receiving mail

    I'm trying to send an email, but when I hit send I get a message that says that my password for the SMTP server has been rejected. I tried the troubleshooter, but that didn't help. As far as I know, my incoming and outgoing servers are right, but I know next to nothing about those. This is happening with the home internet connection by the way, I'm not using another source.

    Did you pay for the .Mac account when you bought your computer, or is this a trial account and perhaps it's expired, so maybe that's the reason you can't send mail? When did you sign up for the account, even if it's not a trial?
    What are the complete settings in Mail for your Incoming and Outgoing servers: i.e., type of account (POP or IMAP), port numbers, authentication method, SSL or not? Don't post your username or password.
    Mulder

  • Need urgent help sending mass mail!

    I use the program "Mail" and have a specific email address for a certain project, and now I need to send all the people who I have coordinated with through that address a very important message.
    I tried selecting all from my inbox, and adding to address book, but it didn't work.
    Is there any way to email everyone that has contacted this particular address all at once? Would be even better if I can put them all into a special address book.
    Thank you so much for your help!

    Hi
    In address book, create a group, add desired users to that group. In Mail create an email and add that group.
    Tony

  • Sending E-Mail from iPhone

    I need help sending e-mail from my iPhone.  What is Host Name, Description and SMTP.  Every time I try to send an e-mail from my iPhione it is rejected.

    You will need to provide that yourself based on whatever email provider you are using. Is this an email account from your ISP, or is it something like Yahoo, Hotmail. You need to get those settings from the email provider.

  • "This message cannot be sent at this time."  I have been getting this pop-up for 3 days when trying to send out mail.  I don't know what to do!  I cannot send mail from this account on any ISP. Please help!

    "This message cannot be sent at this time."  I have been getting this pop-up for 3 days when trying to send out mail.  I don't know what to do!  I cannot send mail from this account on any ISP. Please help!

    lots of people seem to be havgin a problem sending email from iCloud webmail.
    does your email address have uppercase characters in it?
    if so, try creating an alias in lowercase (go to preferences in iCloud webmail and select 'accounts') and see if email sends okay from that

  • Help required in sending automated mails to hr-coordinator

    Dear Friends,
    I have a requirement where to send the mails to HR co-ordinator via r3-program
    suggestions are appreciated, Help me in this regard.
    Thanks in advance.
    Regards,
    nallani.

    Hi Nallani,
    Write a <Zprogram>, use your own logic in the program to send mails.
    Example: Suppose mails should be generated to the respective administrators when a employee is hired.
    clue - once IT 0001 is saved you should generate a mails.
    Solution: My logic is, check Personnel area & Personnel sub-area, based  on this in IT 0001 - pick up respective Administrator for that employee, and run the program to send mails.
    for this you need to maintain Dynamic actions for IT 0001, there you need to  maintain your <Zprogram>, while change/create of IT 0001, <Zprogram> should be executed
    [Insure the respective administrators maintained with their e-mail id addresses]
    Hope you got an idea how to make a show for your query?
    Cheers,
    TG

  • Please help, how to send mails faster / send more mails per hour

    hello,
    in my application i am using mail sender class i have created to send mail to the users to participate in a survey. following is the code for it. i would like to know if there is anything wrong in it coz it takes to much time to send the mails it is taking 2 minustes to send 6 mails i.e 360 mails per hour only.
    following is how i instantiate the mail sender class and then generate a http link string dynamically as it is different for all the user.
    //////////class where mail sender is instantiated////////////////////
    try
    setConnection();
    st=con.createStatement();
    rs=st.executeQuery("select * from "+CNAME+"_campaign");                         
    String SurveyT = new String();
    while(rs.next())
         SurveyT = rs.getString(2);
    rs.close();
    rs=st.executeQuery("select * from "+CNAME+"_user");     
    ss = new MailSender();
    while(rs.next())
         String userid = rs.getString("userid");
         String password = rs.getString("password");
    StringBuffer message = new StringBuffer(BodyText.getText().trim());
    if(SurveyT.equals("invitational") || SurveyT.equals("single"))
                                            message.append( "\n" + "http://"+IPadd.getText().trim()+"/"+CNAME+"/servlet/login?username="+userid+"&passw="+password);
                                            ss.send(FromField.getText().trim(),userid,SmtpServerID.getText().trim(),MailSub.getText().trim(),message.toString());
    else if(SurveyT.equals("general"))
    message.append( "\n" + "http://"+IPadd.getText().trim()+"/"+CNAME+"/Index.html");
    ss.send(FromField.getText().trim(),userid,SmtpServerID.getText().trim(),MailSub.getText().trim(),message.toString());
    st.close();
    this.dispose();
    catch(SQLException sqlex)
    JOptionPane.showMessageDialog(null,sqlex.getMessage());
    //Mail Sender class/////////////////
    import javax.mail.*;
    import javax.mail.internet.*;
    import java.util.*;
    import javax.swing.*;
    public class MailSender
         String sentAddr,fromAddr,smtpServer,body,subject;
         public MailSender()
         //function send to send the mail
    public void send(String from,String to,String smtps,String subj,String messagetext)
              fromAddr=new String(from);
              sentAddr=new String(to);
              smtpServer=new String(smtps);
              body=new String(messagetext);
              subject=new String(subj);
              try
                   Properties props = System.getProperties();
                   props.put("mail.smtp.host",smtpServer);
         Session session = Session.getDefaultInstance(props,null);
    Message msg = new MimeMessage(session);
                   msg.setFrom(new InternetAddress(fromAddr));
    msg.setRecipients(Message.RecipientType.TO,InternetAddress.parse(sentAddr,false));
         msg.setSubject(subject);
         msg.setText(body);
    msg.setHeader("Survey","MailCheck");
    msg.setSentDate(new Date());
         Transport.send(msg);
         catch(MessagingException mex)
              JOptionPane.showMessageDialog(null,mex.getMessage());
    }

    Lots of variables here....Also my maths says only 180 per hour.... i.e. three a minute.
    1) you are using a database to get info from. What is the average response time of the DB server? Looks like you are doing one SQL then reading the result table but does the initial SQL take a while?
    2) how much data are you passing on to the SMTP server and how fast/slow is the link to that SMTP server? Work out the absolute max amount of data you can transfer over the link then get your average message size and work out a VERY theoretical Max number of messages a minute. Note that real life might approach 80% of this taking TCP/IP and SMTP overheads into account.
    3) What sort of load is the SMTP server under? If it's busy you will be only getting a fraction of whatever bandwidth is available. Depending on its design it may be trying to deliver the first message you sent it while you are still pumping more messages down to it. SMTP servers may limit the number of connections per minute from another machine in order to defeat a denial of service attack. Your code makes a connection per email so this may have relevence here.
    4) Raw horsepower always helps. When I write stuff to do things like this there is no nice GUI screen etc. Just basic Java that if it has to will write a log if something goes wrong. Maybe just maybe a counter on STD out to show it is still actually doing something. Keep the number of classes used down to the bare minimum. In the old days we used to spend days paring code to the bone - a skill somewhat lost these days.
    Hope this gives you some help in finding the bottleneck.
    Cheers,
    SH

  • Need help: Sending mail to internet address without commit work statement

    Dear Experts,
            I have a problem in sending mails from sap to internet address.Am using the function module
    SO_NEW_DOCUMENT_SEND_API1 and am passing parameters like,
    CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
         EXPORTING
              DOCUMENT_TYPE  = 'RAW'
              DOCUMENT_DATA  = DOC_CHNG
              PUT_IN_OUTBOX  = 'X'
         TABLES
              OBJECT_CONTENT = OBJCONT
              RECEIVERS      = RECLIST
         EXCEPTIONS
              TOO_MANY_RECEIVERS         = 1
              DOCUMENT_NOT_SENT          = 2
              OPERATION_NO_AUTHORIZATION = 4
              OTHERS                     = 99.
    submit rsconn01 with mode = 'INT'
                        with output = 'X'
                        and return.
    My problem here is,with the commit work statement after FM, the mail is triggering correctly.but if, am not using the commit work statement,at the very first time of execution mail is not triggering, and the second time of execution first mail is triggering like wise it is going.The status of the message is waiting in queue.
    i have refresh receiver's list also.I want to use this concept in badi.So anyone can pls help me,how to send a mail without commit work statement.
    Thanks in advance.

    There is a parameter Commit_Work pass it as 'X'
    <code>
    CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
    EXPORTING
    DOCUMENT_TYPE = 'RAW'
    DOCUMENT_DATA = DOC_CHNG
    PUT_IN_OUTBOX = 'X'
    commit_work = 'X'
    TABLES
    OBJECT_CONTENT = OBJCONT
    RECEIVERS = RECLIST
    EXCEPTIONS
    TOO_MANY_RECEIVERS = 1
    DOCUMENT_NOT_SENT = 2
    OPERATION_NO_AUTHORIZATION = 4
    OTHERS = 99.
    submit rsconn01 with mode = 'INT'
    with output = 'X'
    and return.
    </code>
    Edited by: Saravanan Ramasamy on Nov 11, 2009 1:31 PM

  • When I am on my home wifi I can send e-mail.  When I am not on my home e-mail but on a wifi network or using the 3g network I cannot send e-mail.  HELP HOW TO FIX.

    When I am on my home wifi I can send e-mail.  When I am not on my home e-mail but on a wifi network or using the 3g network I cannot send e-mail.  HELP HOW TO FIX.

    I know this question is a few years old now, but I recently found myself having the exact same issues;
    Using my iphone or ipad at home created no problems at all, but I couldn't send e mails when away from my home network.
    I recently switched broadband supplier at home and set up a new e mail address, then my problems began!
    I openly admit I'm not great with technology and, to be honest, some of the answers provided on these forums confuse me more than the questions!
    But this worked for me:
    I went along the lines that the fault wasn't with my idevice but possibly with the broadband provider (in my case Plusnet) so I contacted their customer support.
    They referred me to the set up process shown below;
    From your home screen press Settings.
    From the setting menu, choose Mail, Contacts, Calendars followed by Add Account…
    From the Add Account… menu choose Other.
    Fill in your Full Name, Email Address, Password and Description and press Next.If you need help with these, there's more detail underneath the screenshot.
    Full name: Enter your name (or the name you'd like people to see when you send them email)
    Email Address: Enter the address you're setting up, this could be a Plusnet address ([email protected]) or a hosted domain address ([email protected])
    Password: Enter the password for your email address (I don't know what this is)
    Description: Enter a useful description of the email address you're setting up (e.g. Mum's email). You can put whatever you want here
    Press Next to continue.
    More settings will appear. Some will already be filled in.Enter the Incoming and Outgoing Mail Server details and press Next. If you need help with these, there's more detail underneath the screenshot.
    IMAP/POP This will default to IMAP - it's up to you which one you want to use (I don't know what to choose)
    Incoming Mail Server settings
    Host Name: For IMAP this is imap.plus.net - for POP, this is mail.plus.net
    User Name & Password: Enter the username and password for the email address you're setting up (I don't know what these are)
    Outgoing Mail Server settings
    Host Name: relay.plus.net
    User Name & Password: These are optional, but if you want to send mail while on the move (e.g. while connected to mobile or wireless networks), we recommend filling these in.Enter the username and password for the email address you're setting up (I don't know what these are)
    When you're finished, press Next.
    If the box shown below appears, press Yes (you may need to do this twice).
    After a minute or two, your email address will be set up and ready to use.If you chose IMAP when setting up you’ll be able to choose whether you want to use Notes (if you chose POP you’ll be taken back to the settings screen from step 2). Press Save when you’re done.
    That's all you need to do. To start checking your email, go back to your home screen and press Mail.
    Now I fully understand that it may be different for each broadband provider but the processes must be similar.
    The key appears to be in setting up the outgoing message server settings in step 5. Where it says "optional, but if you want to send mail while on the move (e.g. while connected to mobile or wireless networks), we recommend filling these in.
    http://www.plus.net/support/email/setup/ios-setup.shtml#pagetop
    Where it says "we recommend" I think it should read "you must fill these in"
    I went back to Settings - Mail,Contacts, Calenders - click on the offending account and click on the account shown.
    Under OUTGOING MAIL SERVER click on the server, in my case relay.plus.net, and click again to show the details. make sure you enter your user name and password and after a few seconds the account will verify and show a load of ticks.
    I tried this on my phone this morning while on 3G only. I sent an email to another of my addresses and immediately got the response that the message couldn't be sent as the recipient was rejected and the message had been placed in my Outbox. I followed the above steps and immediately heard the satisfying "whoosh" as my mail was sent. 10 seconds later another satisying beep as my e mail arrived at my alternate account.
    Hope this helps anyone else with a similar problem.

  • I have just updated to iso5 on my ipod 4th gen and now i can not send e-mail please help

    since updating to ISO5 i can no longer send e-mails form my ipod touch 4th gen.
    I could befor and the settings all look ok to me but no luck.
    Any help would be appreciated.

    Have you tried the usual cures such as resetting your phone or backing it up then restoring from the backup?

  • Hi I have this problem that when I send a mail to someone mails that I have already sent out end up on this email sometimes two or even twenty different mails end up going to the person I'm send ding a mail too please help

    Hi I have this problem that when I send a mail to someone mails that I have already sent out end up on this email sometimes two or even twenty different mails end up going to the person I'm send ding a mail too please help

    I have been doing some test now and have found out that my mails are being merged according to subject eg, so if I use cleaning goods as a subject and send out a new mail all mails with this subject are sent to the one person

  • TS2998 Help!!! All of a sudden my "send" in Mail is greyed out and i cannot send emails. Any ideas, I can receive them ok.

    Can anyone help me......... All of a sudden my "send" in Mail is greyed out, I can receive mail but cannot reply or send a new mail message.

    Austin,
    Connection doctor says all accounts are connected.
    I have two email accounts setup and my business one appears to be ok (can reply and send ok).
    The main account has the "send" button greyed out.
    And now my F4 button does not open the set apps e.g. calender/calculator etc instead it opens "manage widgets"
    This all seems to have started since the system updated OSX to 10.6.8

  • My iPod touch will not send e mail. Can someone help?

    My iPod touch will not send e mail. I have tried for months now and have no success. It connects to many different wifi networks with no problem it even receives e mail but it will not let me respond or send newly composed e mail.
    Can someone help me out?

    Hey,
    Who is providing the email account? Most email accounts provided by Internet Service Providers will only let you send emails when connected to the Internet over their connection.
    You can try entering your email address on the iPhone Mail Setup Assistant, if its a common provider the settings will be displayed.
    http://www.apple.com/support/iphone/mailhelper/
    Jason

  • We had broadband with BT and I had no problem sending e-mails. We then changed to TalkTalk  and I cannot send any e-mails and do not understand why. can anyone help? We are not techy at all and struggle when things go wrong.

    We used to have BT as our broadband provider and then switched to Talk Talk. Since the switch we cannot send e mails although we are receiving them on the old address. We don't understand what has gone wrong. Can anyone help?
    Thank you
    Ellie

    You need to contact T-T and find out their SMTP settings ( which allows the sending of emails over wifi via your ISP) This info is probably on their website
    I assume you do not have a 3G iPad .In which case go to  the Apple site
    http://www.apple.com/support/ipad/
    where you should find very clear guidance on most issues

Maybe you are looking for

  • How to backup apps and music from an iphone 3g using itunes 11

    Hi, my godson has been using an iPhone 3G as an iPod for music and gaming apps. I want to give him my iPhone 4 (not a 4S) and I have iTunes 11 (registered with my appleID) on my Win8 laptop. I've done a Backup of the 3G and then restored to the 4, th

  • BDC or BAPI for me01 and me02 please read the requirement below

    Hi Experts I am having one requirement ,that I need to write a BDC program for Source list My alt file is having 3 filed with matnr werks lifnr if the material no and werks are same and the lifnr is not existing then it has to add the new vendor with

  • IDVD won't open

    Hello, all. I need help again,please. I did something here that somehow screwed up Idvd. I went to Get Info of Quicktime player, Flip4mac and Idvd and changed Ownership & permissions to "read and write". Why?? 'cause I thought that It would solve a f

  • CRVS2010 Beta - Crystal Reports: Mixed Mode Assembly

    I am trying to find the way to get my report to load current data (from a sql 2008 table) and display the report.  I have tried the following code sets: Dim DS As New DataSet ' Create a datatable in your dataset. The datatable's name ' must match tha

  • Trouble with youtube

    On my MacBook Pro, youtube videos just don't work - will start but then buffer - over and over.  I have the lastest version of software. Is there a fix?